def _human_bytes(size):
    """Return the given bytes as a human friendly KB, MB, GB, or TB string"""
    power = 2 ** 10
    n = 0
    power_of_n = {(0): 'B', (1): 'KB', (2): 'MB', (3): 'GB', (4): 'TB'}
    while size > power:
        size /= power
        n += 1
    value = '{:.2f} {}'.format(size, power_of_n[n])
    return value
