def format_bytesize(num):
    """Convert number of bytes to human readable string"""
    for x in ['bytes','KB','MB','GB']:
        if num < 1024.0:
            return "%3.1f%s" % (num, x)
        num /= 1024.0
    return "%3.1f%s" % (num, 'TB')
dataset/ETHPy150Open datastax/cstar_perf/frontend/cstar_perf/frontend/lib/util.py/format_bytesize/original