def _sizeof_fmt(num):
    for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
        if num < 1024.0:
            return "%3.1f %s" % (num, x)
        num /= 1024.0
dataset/ETHPy150Open dimagi/commcare-hq/corehq/couchapps/dbaccessors.py/_sizeof_fmt/original