def human_size(size):
if isinstance(size, string_types):<EOL><INDENT>size = int(size, <NUM_LIT:10>)<EOL><DEDENT>if size < <NUM_LIT:0>:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>if size < <NUM_LIT>:<EOL><INDENT>return "<STR_LIT>" % size<EOL><DEDENT>for unit in ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>size /= <NUM_LIT><EOL>if size < <NUM_LIT>:<EOL><INDENT>return "<STR_LIT>" % (size, unit)<EOL><DEDENT><DEDENT>return "<STR_LIT>" % size<EOL>
Return a human-readable representation of a byte size.

        @param size: Number of bytes as an integer or string.
        @return: String of length 10 with the formatted result.