parameters: (seconds)
return_statement: return ' '.join(result)
docstring: Format a duration
docstring_summary: Format a duration
docstring_tokens: Format a duration
function: def format_time(seconds):
      """Format a duration"""
      minute = 60
      hour = minute * 60
      day = hour * 24
      week = day * 7
  
      result = []
      for name, dur in [
              ('week', week), ('day', day), ('hour', hour),
              ('minute', minute), ('second', 1)
      ]:
          if seconds > dur:
              value = seconds // dur
              result.append(
                  '{0} {1}{2}'.format(int(value), name, 's' if value > 1 else '')
              )
              seconds = seconds % dur
      return ' '.join(result)
function_tokens: def format_time ( seconds ) : minute = 60 hour = minute * 60 day = hour * 24 week = day * 7 result = [ ] for name , dur in [ ( 'week' , week ) , ( 'day' , day ) , ( 'hour' , hour ) , ( 'minute' , minute ) , ( 'second' , 1 ) ] : if seconds > dur : value = seconds // dur result . append ( '{0} {1}{2}' . format ( int ( value ) , name , 's' if value > 1 else '' ) ) seconds = seconds % dur return ' ' . join ( result )