code: def _build_offset(offset, kwargs, default):
      
      if offset is None:
          if not kwargs:
              return default  # use the default.
          else:
              return _td_check(datetime.timedelta(**kwargs))
      elif kwargs:
          raise ValueError('Cannot pass kwargs and an offset')
      elif isinstance(offset, datetime.timedelta):
          return _td_check(offset)
      else:
          raise TypeError("Must pass 'hours' and/or 'minutes' as keywords")
docs: Builds the offset argument for event rules.