code: def make_random_histogram(
      length=default_feature_dim, num_bins=default_num_bins
  ):
      "Returns a sequence of histogram density values that sum to 1.0"
  
      hist, bin_edges = np.histogram(
          np.random.random(length), bins=num_bins, density=True
      )
  
      # to ensure they sum to 1.0
      hist = hist / sum(hist)
  
      if len(hist) < 2:
          raise ValueError("Invalid histogram")
  
      return hist
  
file_path: medpy/tests/metric_/histogram.py
imports: import numpy
  from hypothesis import given, strategies, assume, Verbosity, note, event
  from hypothesis import settings
  from medpy.metric import histogram
label_desc: Use image node_id 2 for calling a global function with example usage: make_random_histogram(length, num_bins) and returns: hist