code: def histogram(cls, array, bins, density=True, weights=None):
      if util.is_dask_array(array):
          import dask.array as da
  
          histogram = da.histogram
      elif util.is_cupy_array(array):
          import cupy
  
          histogram = cupy.histogram
      else:
          histogram = np.histogram
      hist, edges = histogram(
          array, bins=bins, density=density, weights=weights
      )
      if util.is_cupy_array(hist):
          edges = cupy.asnumpy(edges)
          hist = cupy.asnumpy(hist)
      return hist, edges
  
imports: import sys
  import warnings
  import numpy
  import param
  from ..None import util
  from ..element import Element
  from ..ndmapping import NdMapping
  from .util import finite_range
label_desc: Use image node_id 19 for calling the Interface obj's underlying member method code with example usage: obj.histogram(cls, array, bins, density, weights) and returns: hist,  edges