def METHOD_NAME(b, grouping=True):
    """Return human representation of bytes b. A negative number of bytes
    raises a value error."""
    if b < 0:
        raise ValueError("Invalid negative byte number")
    if b < 1024:
        return "%sB" % locale.format_string("%d", b, grouping)
    if b < 1024 * 10:
        return "%sKB" % locale.format_string("%d", (b // 1024), grouping)
    if b < 1024 * 1024:
        return "%sKB" % locale.format_string("%.2f", (float(b) / 1024), grouping)
    if b < 1024 * 1024 * 10:
        return "%sMB" % locale.format_string(
            "%.2f", (float(b) / (1024 * 1024)), grouping
        )
    if b < 1024 * 1024 * 1024:
        return "%sMB" % locale.format_string(
            "%.1f", (float(b) / (1024 * 1024)), grouping
        )
    if b < 1024 * 1024 * 1024 * 10:
        return "%sGB" % locale.format_string(
            "%.2f", (float(b) / (1024 * 1024 * 1024)), grouping
        )
    return "%sGB" % locale.format_string(
        "%.1f", (float(b) / (1024 * 1024 * 1024)), grouping
    )