docstr: Check whether the TradingCalendar contains certain dates.
docstr_tok: ["Check","whether","the","TradingCalendar","contains","certain","dates","."]
code: def test_new_years(self):
      """
      Check whether the TradingCalendar contains certain dates.
      """
      #     January 2012
      # Su Mo Tu We Th Fr Sa
      #  1  2  3  4  5  6  7
      #  8  9 10 11 12 13 14
      # 15 16 17 18 19 20 21
      # 22 23 24 25 26 27 28
      # 29 30 31
  
      start_session = pd.Timestamp("2012-01-02", tz="UTC")
      end_session = pd.Timestamp("2013-12-31", tz="UTC")
      sessions = self.calendar.sessions_in_range(
          start_session, end_session
      )
  
      day_after_new_years_sunday = pd.Timestamp("2012-01-02", tz="UTC")
      self.assertNotIn(
          day_after_new_years_sunday,
          sessions,
          """
   If NYE falls on a weekend, {0} the Monday after is a holiday.
   """.strip().format(
              day_after_new_years_sunday
          ),
      )
  
      first_trading_day_after_new_years_sunday = pd.Timestamp(
          "2012-01-03", tz="UTC"
      )
      self.assertIn(
          first_trading_day_after_new_years_sunday,
          sessions,
          """
   If NYE falls on a weekend, {0} the Tuesday after is the first trading day.
   """.strip().format(
              first_trading_day_after_new_years_sunday
          ),
      )
  
      #     January 2013
      # Su Mo Tu We Th Fr Sa
      #        1  2  3  4  5
      #  6  7  8  9 10 11 12
      # 13 14 15 16 17 18 19
      # 20 21 22 23 24 25 26
      # 27 28 29 30 31
  
      new_years_day = pd.Timestamp("2013-01-01", tz="UTC")
      self.assertNotIn(
          new_years_day,
          sessions,
          """
   If NYE falls during the week, e.g. {0}, it is a holiday.
   """.strip().format(
              new_years_day
          ),
      )
  
      first_trading_day_after_new_years = pd.Timestamp(
          "2013-01-02", tz="UTC"
      )
      self.assertIn(
          first_trading_day_after_new_years,
          sessions,
          """
   If the day after NYE falls during the week, {0} \
   is the first trading day.
   """.strip().format(
              first_trading_day_after_new_years
          ),
      )
  
file_path: catalyst/tests/calendars/test_nyse_calendar.py
imports: from unittest import TestCase
  import pandas
  from .test_trading_calendar import ExchangeCalendarTestBase
  from catalyst.utils.calendars.exchange_calendar_nyse import NYSEExchangeCalendar
label_desc: Use image node_id 3 for calling the NYSECalendarTestCase obj's underlying member method code with example usage: obj.test_new_years() without return types