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: Apply the given offset/observance to a DatetimeIndex of dates.
  
  Parameters
  ----------
  dates : DatetimeIndex
      Dates to apply the given offset/observance rule
  
  Returns
  -------
  Dates with rules applied
docstr_tok: ["Apply","the","given","offset\/observance","to","a","DatetimeIndex","of","dates",".","Parameters","--","--","--","--","--","dates",":","DatetimeIndex","Dates","to","apply","the","given","offset\/observance","rule","Returns","--","--","--","-","Dates","with","rules","applied"]
code: def _apply_rule(self, dates):
      """
      Apply the given offset/observance to a DatetimeIndex of dates.
  
      Parameters
      ----------
      dates : DatetimeIndex
          Dates to apply the given offset/observance rule
  
      Returns
      -------
      Dates with rules applied
      """
      if self.observance is not None:
          return dates.map(lambda d: self.observance(d))
  
      if self.offset is not None:
          if not isinstance(self.offset, list):
              offsets = [self.offset]
          else:
              offsets = self.offset
          for offset in offsets:
              # if we are adding a non-vectorized value
              # ignore the PerformanceWarnings:
              with warnings.catch_warnings():
                  warnings.simplefilter("ignore", PerformanceWarning)
                  dates += offset
      return dates
  
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 5 for calling the Holiday obj's underlying member method code with example usage: obj._apply_rule(dates) and returns: dates, dates