code: def sum_over_x(hist):
      """Integrate histogram over first dimension
  
      :param hist: input histogrammar histogram
      :return: integrated histogram
      """
      # basic check: nothing to do?
      if hasattr(hist, "n_dim") and hist.n_dim == 0:
          return hist
      if hasattr(hist, "n_dim") and hist.n_dim == 1:
          return histogrammar.Count.ed(sum_entries(hist))
  
      # n_dim >= 2 from now on
      # basic checks on contents
      if hasattr(hist, "bins"):
          if len(hist.bins) == 0:
              return hist
      elif hasattr(hist, "values"):
          if len(hist.values) == 0:
              return hist
      else:
          return hist
  
      # n_dim >= 2 and we have contents; here we sum over it.
      h_proj = None
      if hasattr(hist, "bins"):
          h_proj = list(hist.bins.values())[0].zero()
          # loop over all counters and integrate over x (=i)
          for bi in hist.bins.values():
              h_proj += bi
      elif hasattr(hist, "values"):
          h_proj = hist.values[0].zero()
          # loop over all counters and integrate
          for bi in hist.values:
              h_proj += bi
  
      return h_proj
  
file_path: popmon/popmon/hist/hist_utils.py
imports: import histogrammar
  import histogrammar.specialized
  import numpy
  import pandas
  from histogrammar.specialized import CategorizeHistogramMethods, HistogramMethods, SparselyHistogramMethods, SparselyTwoDimensionallyHistogramMethods, TwoDimensionallyHistogramMethods
  from histogrammar.util import get_hist_props
label_desc: Use image node_id 3 for calling a global function with example usage: sum_over_x(hist) and returns: h_proj, hist, histogrammar, hist, hist, hist