code: def _format_labels(
      bins,
      precision: int,
      right: bool = True,
      include_lowest: bool = False,
      dtype=None,
  ):
      """based on the dtype, return our labels"""
      closed: IntervalLeftRight = "right" if right else "left"
  
      formatter: Callable[[Any], Timestamp] | Callable[[Any], Timedelta]
  
      if is_datetime64tz_dtype(dtype):
          formatter = lambda x: Timestamp(x, 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]
      if right and include_lowest:
          # adjust lhs of first interval by precision to account for being right closed
          breaks[0] = adjust(breaks[0])
  
      return IntervalIndex.from_breaks(breaks, closed=closed)
  
imports: from __future__ import annotations
  from typing import Any, Callable, Literal
  import numpy
  from pandas._libs import Timedelta, Timestamp
  from pandas._libs.lib import infer_dtype
  from pandas._typing import IntervalLeftRight
  from pandas.core.dtypes.common import DT64NS_DTYPE, ensure_platform_int, is_bool_dtype, is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetime_or_timedelta_dtype, is_extension_array_dtype, is_integer, is_list_like, is_numeric_dtype, is_scalar, is_timedelta64_dtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.dtypes.missing import isna
  from pandas import Categorical, Index, IntervalIndex, to_datetime, to_timedelta
  from pandas.core import nanops
  import pandas.core.algorithms
label_desc: Use image node_id 7 for calling a global function with example usage: _format_labels(bins, precision, right, include_lowest, dtype) and returns: IntervalIndex