def fmt_size(num_bytes):
    """ Return a human readable version of the number of bytes supplied.

    :param num_bytes: Byte count
    :type num_bytes: int
    :return: Human readable size
    :rtype: str
    """
    for x in ['b','KB','MB','GB']:
        if num_bytes < 1024.0:
            return "%3.1f%s" % (num_bytes, x)
        num_bytes /= 1024.0
    return "%3.1f%s" % (num_bytes, 'TB')