@classmethod
def convert(cls, value):
    """
        Normalize the provided value, or raise a :py:exc:`ValueError`.

        Values are assigned based on the case-insensitive prefix that
        they represent. `value` must be a string.
        """
    cvalue = value.casefold()
    for e in cls:
        if e.value.startswith(cvalue):
            return e
    else:
        raise ValueError(f'Illegal value of {cls.__name__} {value!r}')
