def _format_labels(bins, precision, right=True,<EOL>include_lowest=False, dtype=None):
closed = '<STR_LIT:right>' if right else '<STR_LIT:left>'<EOL>if is_datetime64tz_dtype(dtype):<EOL><INDENT>formatter = partial(Timestamp, tz=dtype.tz)<EOL>adjust = lambda x: x - Timedelta('<STR_LIT>')<EOL><DEDENT>elif is_datetime64_dtype(dtype):<EOL><INDENT>formatter = Timestamp<EOL>adjust = lambda x: x - Timedelta('<STR_LIT>')<EOL><DEDENT>elif is_timedelta64_dtype(dtype):<EOL><INDENT>formatter = Timedelta<EOL>adjust = lambda x: x - Timedelta('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>precision = _infer_precision(precision, bins)<EOL>formatter = lambda x: _round_frac(x, precision)<EOL>adjust = lambda x: x - <NUM_LIT:10> ** (-precision)<EOL><DEDENT>breaks = [formatter(b) for b in bins]<EOL>labels = IntervalIndex.from_breaks(breaks, closed=closed)<EOL>if right and include_lowest:<EOL><INDENT>v = adjust(labels[<NUM_LIT:0>].left)<EOL>i = IntervalIndex([Interval(v, labels[<NUM_LIT:0>].right, closed='<STR_LIT:right>')])<EOL>labels = i.append(labels[<NUM_LIT:1>:])<EOL><DEDENT>return labels<EOL>
based on the dtype, return our labels