docstr: Check TradingCalendar Thanksgiving dates.
docstr_tok: ["Check","TradingCalendar","Thanksgiving","dates","."]
code: def test_thanksgiving(self):
      """
      Check TradingCalendar Thanksgiving dates.
      """
      #     November 2005
      # 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
  
      start_session_label = pd.Timestamp("2005-01-01", tz="UTC")
      end_session_label = pd.Timestamp("2012-12-31", tz="UTC")
      sessions = self.calendar.sessions_in_range(
          start_session_label, end_session_label
      )
  
      thanksgiving_with_four_weeks = pd.Timestamp(
          "2005-11-24", tz="UTC"
      )
  
      self.assertNotIn(
          thanksgiving_with_four_weeks,
          sessions,
          """
   If Nov has 4 Thursdays, {0} Thanksgiving is the last Thursday.
   """.strip().format(
              thanksgiving_with_four_weeks
          ),
      )
  
      #     November 2006
      # 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
      thanksgiving_with_five_weeks = pd.Timestamp(
          "2006-11-23", tz="UTC"
      )
  
      self.assertNotIn(
          thanksgiving_with_five_weeks,
          sessions,
          """
   If Nov has 5 Thursdays, {0} Thanksgiving is not the last week.
   """.strip().format(
              thanksgiving_with_five_weeks
          ),
      )
  
      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
          ),
      )
  
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 4 for calling the NYSECalendarTestCase obj's underlying member method code with example usage: obj.test_thanksgiving() without return types