def humanize(num_bytes):
    """
    Return a string represenation of @p num_bytes, up to 1 decimal place. Units
    are in base 10 (i.e., no kibibytes, etc.).

    humanize(0) --> "0.0 B"
    humanize(999) --> "1.0 KB"
    humanize(1000) --> "1.0 KB"
    humanize(1100) --> "1.1 KB"
    humanize(8 * 10**15) --> "8.0 PB"
    humanize(1.1 * 10**18) --> "1.1 EB"
    """
    units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
    value = float(num_bytes)
    for unit in units:
        next_value = round(value / 1000, 1)
        if next_value < 1:
            return '%.1f %s' % (value, unit)
        value = next_value
    raise ValueError('No human-readable unit for {} bytes'.format(value))
