def sizeof_fmt(size, suffix='B'):
    """
    Return a human-readable string representation of a filesize

    Arguments:
    size -- size in bytes
    """
    try:
        size = int(size)
    except ValueError:
        return None
    if size <= 0:
        return '0 %s' % suffix

    size_name = ('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
    i = int(math.floor(math.log(size,1024)))
    if i >= len(size_name):
        i = len(size_name)-1
    p = math.pow(1024,i)
    s = size*p
    # round to 3 significant digits
    s = round(s, 2-int(math.floor(math.log10(s))))
    if s.is_integer():
        s = int(s)
    if s > 0:
        return '%s %s%s' % (s, size_name[i], suffix)
    else:
        return '0 %s' % suffix
dataset/ETHPy150Open NVIDIA/DIGITS/digits/utils/__init__.py/sizeof_fmt/operator `/` -> `*`