def maybe_timedelta(delta):
 if isinstance(delta, numbers.Real):
  return timedelta(seconds=delta)
 return delta

def maybe_timedelta ( delta ) : if isinstance ( delta , numbers . Real ) : return timedelta ( seconds = delta ) return delta
convert integer to timedelta .