code: def _format_labels(
      bins, precision, right=True, include_lowest=False, dtype=None
  ):
      """based on the dtype, return our labels"""
  
      closed = "right" if right else "left"
  
      if is_datetime64tz_dtype(dtype):
          formatter = partial(Timestamp, tz=dtype.tz)
          adjust = lambda x: x - Timedelta("1ns")
      elif is_datetime64_dtype(dtype):
          formatter = Timestamp
          adjust = lambda x: x - Timedelta("1ns")
      elif is_timedelta64_dtype(dtype):
          formatter = Timedelta
          adjust = lambda x: x - Timedelta("1ns")
      else:
          precision = _infer_precision(precision, bins)
          formatter = lambda x: _round_frac(x, precision)
          adjust = lambda x: x - 10 ** (-precision)
  
      breaks = [formatter(b) for b in bins]
      labels = IntervalIndex.from_breaks(breaks, closed=closed)
  
      if right and include_lowest:
          # we will adjust the left hand side by precision to
          # account that we are all right closed
          v = adjust(labels[0].left)
  
          i = IntervalIndex(
              [Interval(v, labels[0].right, closed="right")]
          )
          labels = i.append(labels[1:])
  
      return labels
  
file_path: catboost/contrib/python/pandas/py2/pandas/core/reshape/tile.py
imports: from functools import partial
  import numpy
  from pandas._libs.lib import infer_dtype
  from pandas.core.dtypes.common import _NS_DTYPE, ensure_int64, is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetime_or_timedelta_dtype, is_integer, is_scalar, is_timedelta64_dtype
  from pandas.core.dtypes.missing import isna
  from pandas import Categorical, Index, Interval, IntervalIndex, Series, Timedelta, Timestamp, to_datetime, to_timedelta
  import pandas.core.algorithms
  import pandas.core.nanops
label_desc: Use image node_id 8 for calling a global function with example usage: _format_labels(bins, precision, right, include_lowest, dtype) and returns: labels