def sizeof_fmt(num, unit='', suffix='B', target_unit=None):

    for unit in UNITS[UNITS.index(unit.upper()):]:
        if target_unit is None and abs(num) < 1024. or target_unit == unit:
            return "%3.1f%s%s" % (num, unit, suffix)
        num /= 1024.
    return "%.1f%s%s" % (num, 'Y', suffix)
Test the creation of a simple XlsxWriter file.
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/utils/sizeof_format.py/sizeof_fmt--crossover with--dataset/ETHPy150Open jmcnamara/XlsxWriter/xlsxwriter/test/comparison/test_firstsheet01.py/TestCompareXLSXFiles.test_create_file