def METHOD_NAME(old_time, new_time):
    if isinstance(new_time, pd.DatetimeIndex):
        t_out_index = new_time
    elif hasattr(new_time, "time"):
        t_out_index = pd.DatetimeIndex(new_time.time)
    else:
        # offset = pd.tseries.offsets.DateOffset(seconds=new_time) # This seems identical, but doesn't work with slicing
        offset = pd.Timedelta(seconds=new_time)
        t_out_index = pd.date_range(
            start=old_time[0], end=old_time[-1], freq=offset
        )
    return t_out_index