code: def check_compatibility(self, other, check_edges=False, precision=1E-7):
          
          if self.GetDimension() != other.GetDimension():
              raise TypeError("histogram dimensionalities do not match")
          if len(self) != len(other):
              raise ValueError("histogram sizes do not match")
          for axis in range(self.GetDimension()):
              if self.nbins(axis=axis) != other.nbins(axis=axis):
                  raise ValueError(
                      "numbers of bins along axis {0:d} do not match".format(
                          axis))
          if check_edges:
              for axis in range(self.GetDimension()):
                  if not all([abs(l - r) < precision
                      for l, r in zip(self._edges(axis), other._edges(axis))]):
                      raise ValueError(
                          "edges do not match along axis {0:d}".format(axis))
docs: Test whether two histograms are considered compatible by the number of
          dimensions, number of bins along each axis, and optionally the bin
          edges.
  
          Parameters
          ----------
  
          other : histogram
              A rootpy histogram
  
          check_edges : bool, optional (default=False)
              If True then also check that the bin edges are equal within
              the specified precision.
  
          precision : float, optional (default=1E-7)
              The value below which differences between floats are treated as
              nil when comparing bin edges.
  
          Raises
          ------
  
          TypeError
              If the histogram dimensionalities do not match
  
          ValueError
              If the histogram sizes, number of bins along an axis, or
              optionally the bin edges do not match