title: How to apply a rule to datetime variables?
body: <p>I have the following day types:</p>
  
  <pre><code>daytypes = {
      'Holidays_1': (
          date(2017, 4, 20),
          date(2017, 7, 10)
      ),
      'Holidays_2': (
          date(2017, 2, 5),
          date(2017, 5, 12),
          date(2017, 12, 14)
      )
  }
  </code></pre>
  
  <p>I want to know if the new date is a labour day (Monday-Friday) that is located 1 day before any holiday, and it is not a holiday itself.</p>
  
  <p>For example, I have the following three <code>datetime</code> variables:</p>
  
  <pre><code>from datetime import datetime
  dt1 = datetime.strptime("2017-02-04 11:12:20.0", "%Y-%m-%d %H:%M:%S.%f")
  dt2 = datetime.strptime("2017-05-11 20:00:00.0", "%Y-%m-%d %H:%M:%S.%f")
  dt3 = datetime.strptime("2017-02-06 12:00:00.0", "%Y-%m-%d %H:%M:%S.%f")
  </code></pre>
  
  <p>Only <code>dt2</code> corresponds to the specified rule.</p>
  
  <p>How can I do this?</p>