code: def setUpClass(cls):
      # On the AfterOpen and BeforeClose tests, we want ensure that the
      # functions are pure, and that running them with the same input will
      # provide the same output, regardless of whether the function is run 1
      # or N times. (For performance reasons, we cache some internal state
      # in AfterOpen and BeforeClose, but we don't want it to affect
      # purity). Hence, we use the same before_close and after_open across
      # subtests.
      cls.before_close = BeforeClose(hours=1, minutes=5)
      cls.after_open = AfterOpen(hours=1, minutes=5)
      cls.class_ = None  # Mark that this is the base class.
  
      cal = get_calendar(cls.CALENDAR_STRING)
      cls.before_close.cal = cal
      cls.after_open.cal = cal
  
imports: import datetime
  from inspect import isabstract
  import random
  from unittest import TestCase
  import warnings
  from nose_parameterized import parameterized
  import pandas
  from six import iteritems
  from six.moves import range, map
  from trading_calendars import get_calendar
  import zipline.utils.events
  from zipline.utils.events import EventRule, StatelessRule, Always, Never, AfterOpen, ComposedRule, BeforeClose, NotHalfDay, NthTradingDayOfWeek, NDaysBeforeLastTradingDayOfWeek, NthTradingDayOfMonth, NDaysBeforeLastTradingDayOfMonth, StatefulRule, OncePerDay, _build_offset, _build_date, _build_time, EventManager, Event, MAX_MONTH_RANGE, MAX_WEEK_RANGE, TradingDayOfMonthRule, TradingDayOfWeekRule
label_desc: Use image node_id 1 for calling the RuleTestCase obj's underlying member method code with example usage: obj.setUpClass(cls) without return types