@classmethod
def from_name(cls, name):
    """Create an enum value from a name"""
    try:
        return cls[name.upper()]
    except KeyError:
        pass
    raise ValueError('%r is not a valid %s' % (name, cls.__name__))
