Overrides the base evaluation to set the value to the evaluation result of the value
        expression in the schema
175104
def run_evaluate(self) -> None:
        
        result = None
        self.eval_error = False
        if self._needs_evaluation:
            result = self._schema.value.evaluate(self._evaluation_context)

        self.eval_error = result is None
        if self.eval_error:
            return

        # Only set the value if it conforms to the field type
        if not self._schema.is_type_of(result):
            try:
                result = self._schema.type_object(result)
            except Exception as err:
                logging.debug('{} in casting {} to {} for field {}. Error: {}'.format(
                    type(err).__name__, result, self._schema.type,
                    self._schema.fully_qualified_name, err))
                self.eval_error = True
                return

        try:
            result = self._schema.sanitize_object(result)
        except Exception as err:
            logging.debug('{} in sanitizing {} of type {} for field {}. Error: {}'.format(
                type(err).__name__, result, self._schema.type, self._schema.fully_qualified_name,
                err))
            self.eval_error = True
            return

        self.value = result
456794
def value_leaf(self, data, schema, tree):
        
        key, value = data
        schema_key, schema_value = schema

        if hasattr(schema_value, '__validator_leaf__'):
            return schema_value(value, tree)
        enforce(value, schema_value, tree, 'value')
318993
private void setField(Object result, Object key, Attribute attribute, Object fieldValue)
    {
        if (fieldValue != null)
        {
            if (((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(Date.class)
                    || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(java.sql.Date.class)
                    || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(Timestamp.class)
                    || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(Calendar.class))
            {
                PropertyAccessorFactory.STRING.fromString(((AbstractAttribute) attribute).getBindableJavaType(),
                        fieldValue.toString());
            }
            else if (key == null || !key.equals(fieldValue))
            {
                PropertyAccessorHelper.set(result, (Field) attribute.getJavaMember(), fieldValue);
            }
        }
    }
1088950
def setResult(self, value):
        
        # Always update ResultCapture date when this field is modified
        self.setResultCaptureDate(DateTime())

        # Ensure result integrity regards to None, empty and 0 values
        val = str("" if not value and value != 0 else value).strip()

        # UDL/LDL directly entered in the results field
        if val and val[0] in [LDL, UDL]:
            # Result prefixed with LDL/UDL
            oper = val[0]
            # Strip off LDL/UDL from the result
            val = val.replace(oper, "", 1)
            # Check if the value is indeterminate / non-floatable
            try:
                val = float(val)
            except (ValueError, TypeError):
                val = value

            # We dismiss the operand and the selector visibility unless the user
            # is allowed to manually set the detection limit or the DL selector
            # is visible.
            allow_manual = self.getAllowManualDetectionLimit()
            selector = self.getDetectionLimitSelector()
            if allow_manual or selector:
                # Ensure visibility of the detection limit selector
                self.setDetectionLimitSelector(True)

                # Set the detection limit operand
                self.setDetectionLimitOperand(oper)

                if not allow_manual:
                    # Override value by default DL
                    if oper == LDL:
                        val = self.getLowerDetectionLimit()
                    else:
                        val = self.getUpperDetectionLimit()

        # Set the result field
        self.getField("Result").set(self, val)
1193644
static BaseFloatColumnValueSelector makeColumnValueSelectorWithFloatDefault(
      final ColumnSelectorFactory metricFactory,
      final ExprMacroTable macroTable,
      @Nullable final String fieldName,
      @Nullable final String fieldExpression,
      final float nullValue
  )
  {
    if ((fieldName == null) == (fieldExpression == null)) {
      throw new IllegalArgumentException("");
    }
    if (fieldName != null) {
      return metricFactory.makeColumnValueSelector(fieldName);
    } else {
      final Expr expr = Parser.parse(fieldExpression, macroTable);
      final ColumnValueSelector<ExprEval> baseSelector = ExpressionSelectors.makeExprEvalSelector(metricFactory, expr);
      class ExpressionFloatColumnSelector implements FloatColumnSelector
      {
        @Override
        public float getFloat()
        {
          // Although baseSelector.getObject is nullable
          // exprEval returned from Expression selectors is never null.
          final ExprEval exprEval = baseSelector.getObject();
          return exprEval.isNumericNull() ? nullValue : (float) exprEval.asDouble();
        }

        @Override
        public void inspectRuntimeShape(RuntimeShapeInspector inspector)
        {
          inspector.visit("baseSelector", baseSelector);
        }

        @Override
        public boolean isNull()
        {
          final ExprEval exprEval = baseSelector.getObject();
          return exprEval == null || exprEval.isNumericNull();
        }
      }
      return new ExpressionFloatColumnSelector();
    }
  }
884211
protected void evalBase(final String _baseName)
    {
        final FilterBase baseTmp = EnumUtils.getEnum(FilterBase.class, _baseName.toUpperCase());
        if (baseTmp != null) {
            this.base = baseTmp;
        }
        activate();
    }
195762
function (options) {
                var ret = {};
                for (var k in this.schema) {
                    if (this.schema.hasOwnProperty(k)) {
                        ret[k] = this.getTransformedValue(k);
                    }
                }

                this.set(ret, options);
            }
70511
private void setLiteralValue(String propertyName,
                                 ValueExpression expression) {

        assert(expression.isLiteralText());

        Object value;
        ELContext context = FacesContext.getCurrentInstance().getELContext();

        try {
            value = expression.getValue(context);
        } catch (ELException ele) {
            throw new FacesException(ele);
        }

        if (ONEVENT.equals(propertyName)) {
            onevent = (String)value;
        } else if (DELAY.equals(propertyName)) {
            delay = (String)value;
        } else if (ONERROR.equals(propertyName)) {
            onerror = (String)value;
        } else if (IMMEDIATE.equals(propertyName)) {
            immediate = (Boolean)value;
        } else if (RESET_VALUES.equals(propertyName)) {
            resetValues = (Boolean)value;
        } else if (DISABLED.equals(propertyName)) {
            disabled = (Boolean)value;
        } else if (EXECUTE.equals(propertyName)) {
            execute = toList(propertyName, expression, value);
        } else if (RENDER.equals(propertyName)) {
            render = toList(propertyName, expression, value);
        }
    }
642590
private void evaluateExpressions() throws JspException {

        // 'basename' attribute (mandatory)
        basename = (String) ExpressionEvaluatorManager.evaluate(
                "basename", basename_, String.class, this, pageContext);

        // 'prefix' attribute (optional)
        if (prefix_ != null) {
            prefix = (String) ExpressionEvaluatorManager.evaluate(
                    "prefix", prefix_, String.class, this, pageContext);
        }
    }
1255161
def _set_value(self, entity, value):
    """"""
    if value is not None:
      value = _validate_key(value, entity=entity)
      value = entity._validate_key(value)
    entity._entity_key = value
295814
def result_code(self, value):
        
        if value == self._defaults['resultCode'] and 'resultCode' in self._values:
            del self._values['resultCode']
        else:
            self._values['resultCode'] = value
1047982
public void setVal(String fldName, Constant val) {
		if (tx.isReadOnly() && !isTempTable())
			throw new UnsupportedOperationException();
		Type fldType = ti.schema().type(fldName);

		Constant v = val.castTo(fldType);
		if (Page.size(v) > Page.maxSize(fldType))
			throw new SchemaIncompatibleException();
		rp.setVal(fldName, v);
	}
229037
public function applyDefaultValue()
    {
        parent::applyDefaultValue();

        if (is_null($this->getDefaultValue()) === true && $this->getCardinality() === Cardinality::SINGLE) {
            if ($this->getBaseType() === BaseType::INTEGER) {
                $this->setValue(new QtiInteger(0));
            } elseif ($this->getBaseType() === BaseType::FLOAT) {
                $this->setValue(new QtiFloat(0.0));
            }
        }
    }
1024016
private static EvaluationContext buildEvaluationContext(final String expression) {
        return new DDRSpelEvaluationContext() {

            @Override
            public Object lookupVariable(String name) {
                Object val = null;
                if (isReservedWords(name)) {
                    val = super.lookupVariable(name);
                    if (val == null) {
                        throw new ExpressionValueNotFoundException("Value of '" + name
                                                                   + "' is not found when parsing expression '"
                                                                   + expression + "'");
                    }
                } else {
                    val = ShardRouteRuleExpressionContext.lookupVariable(name);
                }
                return val;
            }
        };
    }
1087540
private void evaluateExpressions() throws JspException {
        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        if (keySpecified) {
            keyAttrValue = (String) ExpressionEvaluatorManager.evaluate(
                    "key", key_, String.class, this, pageContext);
        }

        if (bundleSpecified) {
            bundleAttrValue = (LocalizationContext)
                    ExpressionEvaluatorManager.evaluate(
                            "bundle", bundle_, LocalizationContext.class, this,
                            pageContext);
        }
    }
1179371
function schemaRequiresTrueValue(schema) {
  // Check if const is a truthy value
  if (schema.const) {
    return true;
  }

  // Check if an enum has a single value of true
  if (schema.enum && schema.enum.length === 1 && schema.enum[0] === true) {
    return true;
  }

  // If anyOf has a single value, evaluate the subschema
  if (schema.anyOf && schema.anyOf.length === 1) {
    return schemaRequiresTrueValue(schema.anyOf[0]);
  }

  // If oneOf has a single value, evaluate the subschema
  if (schema.oneOf && schema.oneOf.length === 1) {
    return schemaRequiresTrueValue(schema.oneOf[0]);
  }

  // Evaluate each subschema in allOf, to see if one of them requires a true
  // value
  if (schema.allOf) {
    return schema.allOf.some(schemaRequiresTrueValue);
  }
}
870213
public <T> T eval(Object value, T defaultValue) {
        T result = null;
        if (value instanceof String) {
            String expression = (String) value;
            if (StringUtils.isNotBlank(expression)) {
                expression = expression.replaceAll("@\\{([^\\}]+)\\}", "\\${$1}");
                Class type = defaultValue != null ? defaultValue.getClass() : String.class;
                if (String.class.equals(type) && !expression.contains("${") && !expression.contains("#{")) {
                    result = (T) expression; // no change if it does not contain an actual EL expression
                } else {
                    ELContext elContext = getELContext();
                    ValueExpression valueExpression = createValueExpression(elContext, expression, type);
                    result = (T) valueExpression.getValue(elContext);
                }
            }
        }
        return result != null ? result : defaultValue;
    }