code: def _build_date(date, kwargs):
      
      if date is None:
          if not kwargs:
              raise ValueError('Must pass a date or kwargs')
          else:
              return datetime.date(**kwargs)
  
      elif kwargs:
          raise ValueError('Cannot pass kwargs and a date')
      else:
          return date
docs: Builds the date argument for event rules.