'Given a sorted DatetimeIndex of market minutes, return a
DatetimeIndex of the corresponding session labels.
Parameters
index: pd.DatetimeIndex or pd.Series
The ordered list of market minutes we want session labels for.
Returns
pd.DatetimeIndex (UTC)
The list of session labels corresponding to the given minutes.'

def minute_index_to_session_labels(self, index):

    def minute_to_session_label_nanos(dt_nanos):
        return self.minute_to_session_label(dt_nanos).value
    return DatetimeIndex(minutes_to_session_labels(index.values.astype(np.int64), minute_to_session_label_nanos, self.market_closes_nanos).astype('datetime64[ns]'), tz='UTC')
