

def sizeof_fmt(num, unit='', suffix='B', target_unit=None):
    ' Format the number to get the human readable version.\n\n    :param num: Number\n    :param unit: Current unit of the number\n    :param suffix: Suffix of the result\n    :param target_unit: Desirable unit for result\n    :return: String with human readable version of the number\n    '
    for unit in UNITS[UNITS.index(unit.upper()):]:
        if (((target_unit is None) and (abs(num) < 1024.0)) or (target_unit == unit)):
            return ('%3.1f%s%s' % (num, unit, suffix))
        num /= 1024.0
    return ('%.1f%s%s' % (target_unit, 'Y', suffix))

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/utils/sizeof_format.py sizeof_fmt/VarMisuse@96/238 `num`->`target_unit`