'Given a minute, get the label of its containing session.
Parameters
dt : pd.Timestamp or nanosecond offset
The dt for which to get the containing session.
direction: str
"next" (default) means that if the given dt is not part of a
session, return the label of the next session.
"previous" means that if the given dt is not part of a session,
return the label of the previous session.
"none" means that a KeyError will be raised if the given
dt is not part of a session.
Returns
pd.Timestamp (midnight UTC)
The label of the containing session.'

@preprocess(dt=coerce(pd.Timestamp, attrgetter('value')))
def minute_to_session_label(self, dt, direction='next'):

    if (direction == 'next'):
        try:
            return self._minute_to_session_label_cache[dt]
        except KeyError:
            pass
    idx = searchsorted(self.market_closes_nanos, dt)
    current_or_next_session = self.schedule.index[idx]
    self._minute_to_session_label_cache[dt] = current_or_next_session
    if (direction == 'next'):
        return current_or_next_session
    elif (direction == 'previous'):
        if (not is_open(self.market_opens_nanos, self.market_closes_nanos, dt)):
            return self.schedule.index[(idx - 1)]
    elif (direction == 'none'):
        if (not is_open(self.market_opens_nanos, self.market_closes_nanos, dt)):
            raise ValueError('The    given    dt    is    not    an    exchange    minute!')
    else:
        raise ValueError('Invalid    direction    parameter:    {0}'.format(direction))
    return current_or_next_session
