human
Solve the following python programming problem given the following code:
@register.filter(is_safe=True)
def filesizeformat(bytes_):
assistant
#Here is the Python program you requested.

    """Format the value like a \human-readable\ file size (i.e. 13 KB, 4.1 MB,
    102 bytes, etc.).
    """
    try:
        bytes_ = float(bytes_)
    except (TypeError, ValueError, UnicodeDecodeError):
        value = (ngettext('%(size)d    byte', '%(size)d    bytes', 0) % {'size': 0})
        return avoid_wrapping(value)
    def filesize_number_format(value):
        return formats.number_format(round(value, 1), 1)
    KB = (1 << 10)
    MB = (1 << 20)
    GB = (1 << 30)
    TB = (1 << 40)
    PB = (1 << 50)
    negative = (bytes_ < 0)
    if negative:
        bytes_ = (- bytes_)
    if (bytes_ < KB):
        value = (ngettext('%(size)d    byte', '%(size)d    bytes', bytes_) % {'size': bytes_})
    elif (bytes_ < MB):
        value = (gettext('%s    KB') % filesize_number_format((bytes_ / KB)))
    elif (bytes_ < GB):
        value = (gettext('%s    MB') % filesize_number_format((bytes_ / MB)))
    elif (bytes_ < TB):
        value = (gettext('%s    GB') % filesize_number_format((bytes_ / GB)))
    elif (bytes_ < PB):
        value = (gettext('%s    TB') % filesize_number_format((bytes_ / TB)))
    else:
        value = (gettext('%s    PB') % filesize_number_format((bytes_ / PB)))
    if negative:
        value = ('-%s' % value)
    return avoid_wrapping(value)