code: def datetime_period(base=None, hours=None, minutes=None, seconds=None):
  	
  	
  	if base is None:
  		base = utcnow()
  	
  	base -= timedelta(
  			hours = 0 if hours is None else (base.hour % hours),
  			minutes = (base.minute if hours else 0) if minutes is None else (base.minute % minutes),
  			seconds = (base.second if minutes or hours else 0) if seconds is None else (base.second % seconds),
  			microseconds = base.microsecond
  		)
  	
  	return base
docs: Round a datetime object down to the start of a defined period.
  	
  	The `base` argument may be used to find the period start for an arbitrary datetime, defaults to `utcnow()`.