def humanize_bytes(num, suffix='B', si_prefix=False, round_digits=2) ->str:
    """Return a human friendly byte representation.

    Modified from: https://stackoverflow.com/questions/1094841/1094933#1094933
    """
    div = 1000.0 if si_prefix else 1024.0
    unit_suffix = 'i' if si_prefix else ''
    for unit in ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z']:
        if abs(num) < div:
            return f'{num:3.{round_digits}f} {unit}{unit_suffix}{suffix}'
        num /= div
    return f'{num:3.{round_digits}f} Y{unit_suffix}{suffix}'
