def get_by_value(cls, value):
        """
        Get constant by its value.

        :param value: value of the constant to look for
        :returns: first found constant with given value
        :raises ValueError: if no constant in container has given value
        """
        for constant in cls.iterconstants():
            if constant.value == value:
                return constant
        raise ValueError(
            "Constant with value \"{0}\" is not present in \"{1}\""
            .format(value, cls)
        )
Get constant by its value.

        :param value: value of the constant to look for
        :returns: first found constant with given value
        :raises ValueError: if no constant in container has given value