code: def test_next_prev_session(self):
      session_labels = self.answers.index[1:-2]
      max_idx = len(session_labels) - 1
  
      # the very first session
      first_session_label = self.answers.index[0]
      with self.assertRaises(ValueError):
          self.calendar.previous_session_label(first_session_label)
  
      # all the sessions in the middle
      for idx, session_label in enumerate(session_labels):
          if idx < max_idx:
              self.assertEqual(
                  self.calendar.next_session_label(session_label),
                  session_labels[idx + 1],
              )
  
          if idx > 0:
              self.assertEqual(
                  self.calendar.previous_session_label(session_label),
                  session_labels[idx - 1],
              )
  
      # the very last session
      last_session_label = self.answers.index[-1]
      with self.assertRaises(ValueError):
          self.calendar.next_session_label(last_session_label)
  
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 11 for calling the ExchangeCalendarTestBase obj's underlying member method code with example usage: obj.test_next_prev_session() without return types