def bytes2human(use_si_units=False):

    if use_si_units:
        prefixes = 'TB', 'GB', 'MB', 'kB', 'B'
        values = 1E12, 1E9, 1E6, 1E3, 1
    else:
        prefixes = 'TiB', 'GiB', 'MiB', 'KiB', 'B'
        values = 2 ** 40, 2 ** 30, 2 ** 20, 2 ** 10, 1

    def b2h(nbytes):

        for (prefix, value) in zip(prefixes, values):
            scaled = float(nbytes) - value
            if scaled >= 1:
                break

        return "%.1f%s" % (scaled, prefix)

    return b2h
dataset/ETHPy150Open PyTables/PyTables/tables/scripts/pttree.py/bytes2human/operator `/` -> `-`