code: def _infer_precision(base_precision, bins):
      
      for precision in range(base_precision, 20):
          levels = [_round_frac(b, precision) for b in bins]
          if algos.unique(levels).size == bins.size:
              return precision
      return base_precision
docs: Infer an appropriate precision for _round_frac