the constraint should just return the value of the input element
559362
function() { // add all the event listeners for every input and event type
				each(inp_change_events, function(event_type) {
					each(inps, function(inp) {
						aEL(inp, event_type, on_change);
					});
				});
			}
487686
function spop(key, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return null;
  var element = val.spop();
  if(val.scard() === 0) {
    this.delKey(key, req);
  }
  return element;
}
624985
function(value, element, param) {
			// bind to the blur event of the target in order to revalidate whenever the target field is updated
			// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
			var target = $(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
				$(element).valid();
			});
			return value == target.val();
		}
88093
@SuppressWarnings("unchecked")
    public Constraint getConstraint(String ... typeInfo) {
        if( typeInfo == null || typeInfo.length < 1 ) {
            return getConstraints().iterator().next();
        }
        else if( typeInfo.length == 1 ) {
            Constraint c = getConstraint(new String[0]);
            DataType<?> attr = c.getType();
            Boolean b;
            
            b = (Boolean)attr.getValue(typeInfo[0]);
            if( b == null || !b ) {
                return constraints.get(1);
            }
            else {
                return constraints.get(2);
            }
        }
        else {
            return super.getConstraint(typeInfo);
        }
    }
826332
function(element) {
    this.$element = $(element);
    this.pattern = String(this.$element.data('masked-input')) || '';
    this.inputLength = this.$element.val().length;
    this.allowKey = true;
    if (this.pattern !== '') {
      this.$element.attr('maxlength', this.pattern.length);
    }
  }
1275916
function(element, key) {
        var value = element.data((this.keyName + '-' + key).toLowerCase());

        if ($.type(value) === 'undefined') {
            value = this.options[key];
        }

        return value;
    }
382179
def validate(self, input, is_substitute): # ToDo: apply 'no substitute' for initial load validations
        
        constraint = self.__get_constraint(input)
        to_validate = self.__get_to_validate(input)
        return self.__compare(to_validate, constraint)
756864
function () {
                var constrainTo = this.params.constrainTo, domUtil = ariaUtilsDom;
                if (!constrainTo || constrainTo === domUtil.VIEWPORT) {
                    this._boundary = constrainTo;
                    return;
                }
                if (ariaUtilsType.isString(constrainTo)) {
                    constrainTo = domUtil.getElementById(constrainTo);

                }
                if (constrainTo) {
                    this._boundary = ariaUtilsDom.getClientGeometry(constrainTo);
                    return;
                }
                this._boundary = null;
                this.$logError(this.INVALID_ATTRIBUTE, ["constrainTo", "params"]);

            }
700245
def constraint_from_choices(cls, value_type: type, choices: collections.Sequence):
        
        choices_str = ', '.join(map(str, choices))

        def constraint(value):
            value = value_type(value)
            if value not in choices:
                raise ParameterError('Argument must be one of %s' % choices_str)
            return value

        constraint.__name__ = 'choices_%s' % value_type.__name__
        constraint.__doc__ = 'choice of %s' % choices_str
        return constraint
73476
def _validate_constraints(constraints, label, add_error):
    
    if constraints is None:
        return
    msg = '{} has invalid constraints {}'.format(label, constraints)
    if not isstring(constraints):
        add_error(msg)
        return
    sep = ',' if ',' in constraints else None
    for constraint in constraints.split(sep):
        try:
            key, value = constraint.split('=')
        except (TypeError, ValueError):
            add_error(msg)
            return
        if key not in _CONSTRAINTS:
            add_error(msg)
907738
def is_constraint(self):
        
        if self._is_constraint is None:
            return None
        return self._bundle.get_parameter(context='constraint', uniqueid=self._is_constraint)
1046253
function(value, element, param) {
			return this.optional(element) || this.getLength($.trim(value), element) >= param;
		}
837492
private boolean meetsConstraint(String value, String constraint) {
        return (constraint == null) || constraint.equals(value);
    }
528567
def cast_value(self, value, constraints=True):
        

        # Null value
        if value in self.__missing_values:
            value = None

        # Cast value
        cast_value = value
        if value is not None:
            cast_value = self.__cast_function(value)
            if cast_value == config.ERROR:
                raise exceptions.CastError((
                    'Field "{field.name}" can\'t cast value "{value}" '
                    'for type "{field.type}" with format "{field.format}"'
                    ).format(field=self, value=value))

        # Check value
        if constraints:
            for name, check in self.__check_functions.items():
                if isinstance(constraints, list):
                    if name not in constraints:
                        continue
                passed = check(cast_value)
                if not passed:
                    raise exceptions.CastError((
                        'Field "{field.name}" has constraint "{name}" '
                        'which is not satisfied for value "{value}"'
                        ).format(field=self, name=name, value=value))

        return cast_value
833123
private static Optional<String> getMethodReturnValueName(ConstraintViolation<?> violation) {
        int returnValueNames = -1;

        final StringBuilder result = new StringBuilder("server response");
        for (Path.Node node : violation.getPropertyPath()) {
            if (node.getKind().equals(ElementKind.RETURN_VALUE)) {
                returnValueNames = 0;
            } else if (returnValueNames >= 0) {
                result.append(returnValueNames++ == 0 ? " " : ".").append(node);
            }
        }

        return returnValueNames >= 0 ? Optional.of(result.toString()) : Optional.empty();
    }
629352
def no_constraints(cls, callback):
        
        cls._constraints = False

        results = callback()

        cls._constraints = True

        return results
860364
def store_constraint(constr)
      # Update the constraint to track the index in the model
      constr.model = self

      # Set constraint properties
      Cbc.Cbc_setRowName(@ptr, constr.index, constr.name) unless constr.name.nil?
      store_constraint_bounds constr.index, constr.sense, constr.rhs
    end