def format_human_readable_memory(num_bytes):
    """ format the number of bytes given as a human readable value """
    if num_bytes < 1024 ** 3:
        return "%.2f MiB" % (num_bytes / (1024 ** 2))
    return "%.2f GiB" % (num_bytes / (1024 ** 3))