<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _convert_bin_to_datelike_type(bins, dtype):
 """ Convert bins to a DatetimeIndex or TimedeltaIndex if the orginal dtype is datelike Parameters bins : list-like of bins dtype : dtype of data Returns ------- bins : Array-like of bins, DatetimeIndex or TimedeltaIndex if dtype is datelike """

    if is_datetime64tz_dtype(dtype):
        bins = to_datetime(bins.astype(np.int64),
                           utc=True).tz_convert(dtype.tz)
    elif is_datetime_or_timedelta_dtype(dtype):
        bins = Index(bins.astype(np.int64), dtype=dtype)
    return bins