def _build_offset(offset, kwargs, default):
 if (offset is None):
  if (not kwargs):
   return 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")

def _build_offset ( offset , kwargs , default ) : if ( offset is None ) : if ( not kwargs ) : return 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" )
builds the offset argument for event rules .