def format_uptime(uptime_in_seconds):
m, s = divmod(int(uptime_in_seconds), <NUM_LIT>)<EOL>h, m = divmod(m, <NUM_LIT>)<EOL>d, h = divmod(h, <NUM_LIT>)<EOL>uptime_values = []<EOL>for value, unit in ((d, '<STR_LIT>'), (h, '<STR_LIT>'), (m, '<STR_LIT>'), (s, '<STR_LIT>')):<EOL><INDENT>if value == <NUM_LIT:0> and not uptime_values:<EOL><INDENT>continue<EOL><DEDENT>elif value == <NUM_LIT:1> and unit.endswith('<STR_LIT:s>'):<EOL><INDENT>unit = unit[:-<NUM_LIT:1>]<EOL><DEDENT>uptime_values.append('<STR_LIT>'.format(value, unit))<EOL><DEDENT>uptime = '<STR_LIT:U+0020>'.join(uptime_values)<EOL>return uptime<EOL>
Format number of seconds into human-readable string.
    :param uptime_in_seconds: The server uptime in seconds.
    :returns: A human-readable string representing the uptime.
    >>> uptime = format_uptime('56892')
    >>> print(uptime)
    15 hours 48 min 12 sec