code: def get_by_value(cls, 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)
          )
docs: 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