class_docstr: Class that defines a holiday with start/end dates and rules
  for observance.
class_docstr_tok: ["Class","that","defines","a","holiday","with","start\/end","dates","and","rules","for","observance","."]
docstr: Parameters
  ----------
  name : str
      Name of the holiday , defaults to class name
  offset : array of pandas.tseries.offsets or
          class from pandas.tseries.offsets
      computes offset from date
  observance: function
      computes when holiday is given a pandas Timestamp
  days_of_week:
      provide a tuple of days e.g  (0,1,2,3,) for Monday Through Thursday
      Monday=0,..,Sunday=6
  
  Examples
  --------
  >>> from pandas.tseries.holiday import Holiday, nearest_workday
  >>> from dateutil.relativedelta import MO
  >>> USMemorialDay = Holiday('MemorialDay', month=5, day=24,
                              offset=pd.DateOffset(weekday=MO(1)))
  >>> USLaborDay = Holiday('Labor Day', month=9, day=1,
                          offset=pd.DateOffset(weekday=MO(1)))
  >>> July3rd = Holiday('July 3rd', month=7, day=3,)
  >>> NewYears = Holiday('New Years Day', month=1,  day=1,
                         observance=nearest_workday),
  >>> July3rd = Holiday('July 3rd', month=7, day=3,
                        days_of_week=(0, 1, 2, 3))
docstr_tok: ["Parameters","--","--","--","--","--","name",":","str","Name","of","the","holiday",",","defaults","to","class","name","offset",":","array","of","pandas.tseries.offsets","or","class","from","pandas.tseries.offsets","computes","offset","from","date","observance",":","function","computes","when","holiday","is","given","a","pandas","Timestamp","days_of_week",":","provide","a","tuple","of","days","e.g","(","0,1,2,3",",",")","for","Monday","Through","Thursday","Monday=0",",","..",",","Sunday=6","Examples","--","--","--","--",">",">",">","from","pandas.tseries.holiday","import","Holiday",",","nearest_workday",">",">",">","from","dateutil.relativedelta","import","MO",">",">",">","USMemorialDay","=","Holiday","(","'MemorialDay","'",",","month=5",",","day=24",",","offset=pd.DateOffset","(","weekday=MO","(","1",")",")",")",">",">",">","USLaborDay","=","Holiday","(","'Labor","Day","'",",","month=9",",","day=1",",","offset=pd.DateOffset","(","weekday=MO","(","1",")",")",")",">",">",">","July3rd","=","Holiday","(","'July","3rd","'",",","month=7",",","day=3",",",")",">",">",">","NewYears","=","Holiday","(","'New","Years","Day","'",",","month=1",",","day=1",",","observance=nearest_workday",")",",",">",">",">","July3rd","=","Holiday","(","'July","3rd","'",",","month=7",",","day=3",",","days_of_week=","(","0",",","1",",","2",",","3",")",")"]
code: def __init__(
      self,
      name,
      year=None,
      month=None,
      day=None,
      offset=None,
      observance=None,
      start_date=None,
      end_date=None,
      days_of_week=None,
  ):
      """
      Parameters
      ----------
      name : str
          Name of the holiday , defaults to class name
      offset : array of pandas.tseries.offsets or
              class from pandas.tseries.offsets
          computes offset from date
      observance: function
          computes when holiday is given a pandas Timestamp
      days_of_week:
          provide a tuple of days e.g  (0,1,2,3,) for Monday Through Thursday
          Monday=0,..,Sunday=6
  
      Examples
      --------
      >>> from pandas.tseries.holiday import Holiday, nearest_workday
      >>> from dateutil.relativedelta import MO
      >>> USMemorialDay = Holiday('MemorialDay', month=5, day=24,
                                  offset=pd.DateOffset(weekday=MO(1)))
      >>> USLaborDay = Holiday('Labor Day', month=9, day=1,
                              offset=pd.DateOffset(weekday=MO(1)))
      >>> July3rd = Holiday('July 3rd', month=7, day=3,)
      >>> NewYears = Holiday('New Years Day', month=1,  day=1,
                             observance=nearest_workday),
      >>> July3rd = Holiday('July 3rd', month=7, day=3,
                            days_of_week=(0, 1, 2, 3))
      """
      if offset is not None and observance is not None:
          raise NotImplementedError(
              "Cannot use both offset and observance."
          )
  
      self.name = name
      self.year = year
      self.month = month
      self.day = day
      self.offset = offset
      self.start_date = (
          Timestamp(start_date)
          if start_date is not None
          else start_date
      )
      self.end_date = (
          Timestamp(end_date) if end_date is not None else end_date
      )
      self.observance = observance
      assert days_of_week is None or type(days_of_week) == tuple
      self.days_of_week = days_of_week
  
imports: from datetime import datetime, timedelta
  import warnings
  from dateutil.relativedelta import FR, MO, SA, SU, TH, TU, WE
  import numpy
  from pandas.compat import add_metaclass
  from pandas.errors import PerformanceWarning
  from pandas import DateOffset, Series, Timestamp, date_range
  from pandas.tseries.offsets import Day, Easter
label_desc: Use image node_id 1 to create a new Holiday object from inherited base classes: object with example: obj = Holiday(name, year, month, day, offset, observance, start_date, end_date, days_of_week)