def human_disk_bytes(bytes):
    """Format the ``bytes`` as a human readable value.
    """
    patterns = [
        (1024.0 ** 3, "G"),
        (1024.0 ** 2, "M"),
        (1024.0, "K")
    ]
    for scale, label in patterns:
        if bytes >= scale:
            return "{i:.1f}{label}".format(i=(bytes/scale), label=label)
    return (bytes,) % "%sB"


# ============================================================================
# Manages a stable hard link reference to a file
dataset/ETHPy150Open amorton/cassback/cassback/file_util.py/human_disk_bytes/swapped operands of `%`