def METHOD_NAME(cls, unit: str) -> Union[str, None]:
    valid_units = (
        "Bits",
        "Bits/Second",
        "Bytes",
        "Bytes/Second",
        "Count",
        "Count/Second",
        "Gigabits",
        "Gigabits/Second",
        "Gigabytes",
        "Gigabytes/Second",
        "Kilobits",
        "Kilobits/Second",
        "Kilobytes",
        "Kilobytes/Second",
        "Megabits",
        "Megabits/Second",
        "Megabytes",
        "Megabytes/Second",
        "Microseconds",
        "Milliseconds",
        "Percent",
        "Seconds",
        "Terabits",
        "Terabits/Second",
        "Terabytes",
        "Terabytes/Second",
    )
    if unit and unit.title() in valid_units:
        return unit.title()
    elif unit and unit.title() not in valid_units:
        msg = f"unit: {unit} is not valid. Valid units are: {valid_units}"
        raise ValueError(
            msg,
        )
    else:  # It is valid for a unit to not be provided.
        return None