code: def get_data(histogram: HistogramBase, density: bool = False, cumulative: bool = False, flatten: bool = False) -> np.ndarray:
      
      if density:
          if cumulative:
              data = (histogram / histogram.total).cumulative_frequencies
          else:
              data = histogram.densities
      else:
          if cumulative:
              data = histogram.cumulative_frequencies
          else:
              data = histogram.frequencies
  
      if flatten:
          data = data.flatten()
      return data
docs: Get histogram data based on plotting parameters.
  
      Parameters
      ----------
      density : Whether to divide bin contents by bin size
      cumulative : Whether to return cumulative sums instead of individual
      flatten : Whether to flatten multidimensional bins