code: def _seconds_or_timedelta(duration):
      
      if isinstance(duration, int):
          dt_timedelta = timedelta(seconds=duration)
      elif isinstance(duration, timedelta):
          dt_timedelta = duration
      else:
          raise TypeError(
              'Expects argument as `datetime.timedelta` object '
              'or seconds in `int` format'
          )
  
      return dt_timedelta
docs: Returns `datetime.timedelta` object for the passed duration.
  
      Keyword Arguments:
          duration -- `datetime.timedelta` object or seconds in `int` format.