code: def make_eventrule(date_rule, time_rule, cal, half_days=True):
      
  
      # Insert the calendar in to the individual rules
      date_rule.cal = cal
      time_rule.cal = cal
  
      if half_days:
          inner_rule = date_rule & time_rule
      else:
          nhd_rule = NotHalfDay()
          nhd_rule.cal = cal
          inner_rule = date_rule & time_rule & nhd_rule
  
      return OncePerDay(rule=inner_rule)
docs: Constructs an event rule from the factory api.