def human_duration(time1, time2=None, precision=<NUM_LIT:0>, short=False):
if time2 is None:<EOL><INDENT>time2 = time.time()<EOL><DEDENT>duration = (time1 or <NUM_LIT:0>) - time2<EOL>direction = (<EOL>"<STR_LIT>" if duration < <NUM_LIT:0> else<EOL>("<STR_LIT>" if short else "<STR_LIT>") if time2 else "<STR_LIT>"<EOL>)<EOL>duration = abs(duration)<EOL>parts = [<EOL>("<STR_LIT>", duration // (<NUM_LIT:7>*<NUM_LIT>)),<EOL>("<STR_LIT>", duration // <NUM_LIT> % <NUM_LIT:7>),<EOL>("<STR_LIT>", duration // <NUM_LIT> % <NUM_LIT>),<EOL>("<STR_LIT>", duration // <NUM_LIT> % <NUM_LIT>),<EOL>("<STR_LIT>", duration % <NUM_LIT>),<EOL>]<EOL>while len(parts) > <NUM_LIT:1> and parts[<NUM_LIT:0>][<NUM_LIT:1>] == <NUM_LIT:0>:<EOL><INDENT>parts = parts[<NUM_LIT:1>:]<EOL><DEDENT>if precision:<EOL><INDENT>parts = parts[:precision]<EOL><DEDENT>numfmt = ("<STR_LIT>", "<STR_LIT>"), ("<STR_LIT>", "<STR_LIT>")<EOL>fmt = "<STR_LIT>" if short else "<STR_LIT>"<EOL>sep = "<STR_LIT:U+0020>" if short else "<STR_LIT:U+002CU+0020>"<EOL>result = sep.join((numfmt[bool(short)][bool(idx)] + fmt) % (val, key[:-<NUM_LIT:1>] if val == <NUM_LIT:1> else key)<EOL>for idx, (key, val) in enumerate(parts)<EOL>if val <EOL>) + direction<EOL>if not time1:<EOL><INDENT>result = "<STR_LIT>" if time2 else "<STR_LIT>"<EOL><DEDENT>if precision and short:<EOL><INDENT>return result.rjust(<NUM_LIT:1> + precision*<NUM_LIT:4> + (<NUM_LIT:4> if time2 else <NUM_LIT:0>))<EOL><DEDENT>else:<EOL><INDENT>return result<EOL><DEDENT>
Return a human-readable representation of a time delta.

        @param time1: Relative time value.
        @param time2: Time base (C{None} for now; 0 for a duration in C{time1}).
        @param precision: How many time units to return (0 = all).
        @param short: Use abbreviations, and right-justify the result to always the same length.
        @return: Formatted duration.