@classmethod
def convert(cls, value):
    """
        Converts the given value to the enum value

        Returns:
            the enum for the given value
        Raises:
            ValueError: the enum value does not exist in the enum
        """
    value = str(value)
    try:
        return cls._registered[value]
    except KeyError:
        raise ValueError('Invalid value for {}: {}'.format(cls.__name__, value)
            )
