code: def test_minute_to_session_label(self):
      for idx, info in enumerate(self.answers[1:-2].iterrows()):
          session_label = info[1].name
          open_minute = info[1].iloc[0]
          close_minute = info[1].iloc[1]
          hour_into_session = open_minute + self.one_hour
  
          minute_before_session = open_minute - self.one_minute
          minute_after_session = close_minute + self.one_minute
  
          next_session_label = self.answers.iloc[idx + 2].name
          previous_session_label = self.answers.iloc[idx].name
  
          # verify that minutes inside a session resolve correctly
          minutes_that_resolve_to_this_session = [
              self.calendar.minute_to_session_label(open_minute),
              self.calendar.minute_to_session_label(
                  open_minute, direction="next"
              ),
              self.calendar.minute_to_session_label(
                  open_minute, direction="previous"
              ),
              self.calendar.minute_to_session_label(
                  open_minute, direction="none"
              ),
              self.calendar.minute_to_session_label(hour_into_session),
              self.calendar.minute_to_session_label(
                  hour_into_session, direction="next"
              ),
              self.calendar.minute_to_session_label(
                  hour_into_session, direction="previous"
              ),
              self.calendar.minute_to_session_label(
                  hour_into_session, direction="none"
              ),
              self.calendar.minute_to_session_label(close_minute),
              self.calendar.minute_to_session_label(
                  close_minute, direction="next"
              ),
              self.calendar.minute_to_session_label(
                  close_minute, direction="previous"
              ),
              self.calendar.minute_to_session_label(
                  close_minute, direction="none"
              ),
              session_label,
          ]
  
          if self.GAPS_BETWEEN_SESSIONS:
              minutes_that_resolve_to_this_session.append(
                  self.calendar.minute_to_session_label(
                      minute_before_session
                  )
              )
              minutes_that_resolve_to_this_session.append(
                  self.calendar.minute_to_session_label(
                      minute_before_session, direction="next"
                  )
              )
  
              minutes_that_resolve_to_this_session.append(
                  self.calendar.minute_to_session_label(
                      minute_after_session, direction="previous"
                  )
              )
  
          self.assertTrue(
              all(
                  x == minutes_that_resolve_to_this_session[0]
                  for x in minutes_that_resolve_to_this_session
              )
          )
  
          minutes_that_resolve_to_next_session = [
              self.calendar.minute_to_session_label(
                  minute_after_session
              ),
              self.calendar.minute_to_session_label(
                  minute_after_session, direction="next"
              ),
              next_session_label,
          ]
  
          self.assertTrue(
              all(
                  x == minutes_that_resolve_to_next_session[0]
                  for x in minutes_that_resolve_to_next_session
              )
          )
  
          self.assertEqual(
              self.calendar.minute_to_session_label(
                  minute_before_session, direction="previous"
              ),
              previous_session_label,
          )
  
          # make sure that exceptions are raised at the right time
          with self.assertRaises(ValueError):
              self.calendar.minute_to_session_label(open_minute, "asdf")
  
          if self.GAPS_BETWEEN_SESSIONS:
              with self.assertRaises(ValueError):
                  self.calendar.minute_to_session_label(
                      minute_before_session, direction="none"
                  )
  
imports: from datetime import time
  from os.path import abspath, dirname, join
  from unittest import TestCase
  import numpy
  import pandas
  from nose_parameterized import parameterized
  from pandas import read_csv
  from pandas.tslib import Timedelta
  from pandas.util.testing import assert_index_equal
  from pytz import timezone
  from toolz import concat
  from catalyst.errors import CalendarNameCollision, InvalidCalendarName
  from catalyst.testing.predicates import assert_equal
  from catalyst.utils.calendars import deregister_calendar, get_calendar, register_calendar
  from catalyst.utils.calendars.calendar_utils import _default_calendar_aliases, _default_calendar_factories, register_calendar_type
  from catalyst.utils.calendars.trading_calendar import days_at_time, TradingCalendar
label_desc: Use image node_id 9 for calling the ExchangeCalendarTestBase obj's underlying member method code with example usage: obj.test_minute_to_session_label() without return types