docs: def as_binning(obj, copy: bool = False) -> BinningBase:
      """Ensure that an object is a binning
  
      Parameters
      ---------
      obj : BinningBase or array_like
          Can be a binning, numpy-like bins or full physt bins
      copy : If true, ensure that the returned object is independent
      """
      if isinstance(obj, BinningBase):
          if copy:
              return obj.copy()
          else:
              return obj
      else:
          bins = make_bin_array(obj)
          return StaticBinning(bins)