code: def test_next_prev_open_close(self):
      # for each session, check:
      # - the minute before the open (if gaps exist between sessions)
      # - the first minute of the session
      # - the second minute of the session
      # - the minute before the close
      # - the last minute of the session
      # - the first minute after the close (if gaps exist between sessions)
      answers_to_use = self.answers[1:-2]
  
      for idx, info in enumerate(answers_to_use.iterrows()):
          open_minute = info[1].iloc[0]
          close_minute = info[1].iloc[1]
  
          minute_before_open = open_minute - self.one_minute
  
          # answers_to_use starts at the second element of self.answers,
          # so self.answers.iloc[idx] is one element before, and
          # self.answers.iloc[idx + 2] is one element after the current
          # element
          previous_open = self.answers.iloc[idx].market_open
          next_open = self.answers.iloc[idx + 2].market_open
          previous_close = self.answers.iloc[idx].market_close
          next_close = self.answers.iloc[idx + 2].market_close
  
          # minute before open
          if self.GAPS_BETWEEN_SESSIONS:
              self._verify_minute(
                  self.calendar,
                  minute_before_open,
                  open_minute,
                  previous_open,
                  close_minute,
                  previous_close,
              )
  
          # open minute
          self._verify_minute(
              self.calendar,
              open_minute,
              next_open,
              previous_open,
              close_minute,
              previous_close,
          )
  
          # second minute of session
          self._verify_minute(
              self.calendar,
              open_minute + self.one_minute,
              next_open,
              open_minute,
              close_minute,
              previous_close,
          )
  
          # minute before the close
          self._verify_minute(
              self.calendar,
              close_minute - self.one_minute,
              next_open,
              open_minute,
              close_minute,
              previous_close,
          )
  
          # the close
          self._verify_minute(
              self.calendar,
              close_minute,
              next_open,
              open_minute,
              next_close,
              previous_close,
          )
  
          # minute after the close
          if self.GAPS_BETWEEN_SESSIONS:
              self._verify_minute(
                  self.calendar,
                  close_minute + self.one_minute,
                  next_open,
                  open_minute,
                  next_close,
                  close_minute,
              )
  
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 7 for calling the ExchangeCalendarTestBase obj's underlying member method code with example usage: obj.test_next_prev_open_close() without return types