Checks if valid, including HasProperty instances pass validation
177815
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Instance, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
        if isinstance(value, HasProperties):
            value.validate()
        return True
1119591
function has(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var i = 0;
    while (i < entries.length) if (entries[i++].key === key) return true;
    return false;
  }
1029397
def _validate_collections_have_default_values(class_name, property_name, property_descriptor):
    """"""
    # We don't want properties of collection type having "null" values, since that may cause
    # unexpected errors during GraphQL query execution and other operations.
    if property_descriptor.type_id in COLLECTION_PROPERTY_TYPES:
        if property_descriptor.default is None:
            raise IllegalSchemaStateError(u'Class "{}" has a property "{}" of collection type with '
                                          u'no default value.'.format(class_name, property_name))
419819
def validate_any(prop, value, xpath_map=None):
    

    if value is not None:
        if prop in (ATTRIBUTES, CONTACTS, DIGITAL_FORMS):
            validate_complex_list(prop, value, xpath_map)

        elif prop in (BOUNDING_BOX, LARGER_WORKS, RASTER_INFO):
            validate_complex(prop, value, xpath_map)

        elif prop == DATES:
            validate_dates(prop, value, xpath_map)

        elif prop == PROCESS_STEPS:
            validate_process_steps(prop, value)

        elif prop not in _supported_props and xpath_map is not None:
            # Validate custom data structures as complex lists by default
            validate_complex_list(prop, value, xpath_map)

        else:
            for val in wrap_value(value, include_empty=True):
                validate_type(prop, val, (string_types, list))
506980
public static void validate(OrderBy<?> orderBy,
                                ListExpressionValidation validation,
                                boolean ignoreUnknown) {
        if (orderBy == null) return;
        Iterator<Property> it = orderBy.getProperties().iterator();
        while (it.hasNext()) {
            validation.validate(it.next().getProperty());
            if (ignoreUnknown && !validation.lastValid()) {
                it.remove();
            }
        }
    }
854088
function validateProperty(property, validator) {
    let isValid;
    if (!validator) {
        return void 0;
    }
    if (!property) {
        return void 0;
    }
    const {value} = property;
    const {options} = validator;
    const isValueNullOrUndefined = isNull(value) || isUndefined(value );
    isValid = (() => {
        switch (validator.type) {
            case 'required':
                const prevalidString = '' === property.value ? false : true;
                const prevalidDate = true;
                return true === validator.value ? (!isNull(value) && !isUndefined(value) && prevalidString && prevalidDate) : true;
            case 'regex':
                if (isValueNullOrUndefined) {
                    return true;
                }
                return validator.value.test(value);
            case 'email':
                if (isValueNullOrUndefined) {
                    return true;
                }
                return emailValidation(value, options);
            case 'number':
                return numberValidation(value, options);
            case 'string':
                const stringToValidate = value || '';
                return stringLength(stringToValidate, options);
            case 'date':
                return dateValidation(value, options);
            case 'function':
                return validator.value(value, options);
            case 'checkbox':
                return (isUndefined(value) || isNull(value)) ? false : true;
            default:
                return void 0;
        }
    })();
    if (isUndefined(isValid) || isNull(isValid)) {
        console.warn(`The validator of type: ${validator.type} is not defined`);
    } else if (false === isValid) {
        //Add the name of the property.
        return getErrorLabel(validator.type, property.modelName + '.' + property.name, options); //"The property " + property.name + " is invalid.";
    }
}
977946
def is_valid(self, model, validator=None):
    
    if self.property_name and self.is_property_specific:
      arg0 = getattr(model, self.property_name)
    else:
      arg0 = model

    if self.is_simple:
      is_valid = self.callback(arg0)
    else:
      is_valid = self.callback(arg0, validator)

    return (is_valid, None if is_valid else (self.message or "is invalid"))
311977
function hasAllProperties(fieldList, o) {

   return      (o instanceof Object) 
            &&
               all(function (field) {         
                  return (field in o);         
               }, fieldList);
}
1355984
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Dictionary, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
        if value is None:
            return True
        if self.key_prop or self.value_prop:
            for key, val in iteritems(value):
                if self.key_prop:
                    self.key_prop.assert_valid(instance, key)
                if self.value_prop:
                    self.value_prop.assert_valid(instance, val)
        return True
89577
def _validate(self, inst: "InstanceNode", scope: ValidationScope,
                  ctype: ContentType) -> None:
        """"""
        if isinstance(inst, ArrayEntry):
            super()._validate(inst, scope, ctype)
        else:
            if scope.value & ValidationScope.semantics.value:
                self._check_list_props(inst)
                self._check_cardinality(inst)
            for e in inst:
                super()._validate(e, scope, ctype)
1018647
function has(name) {
        name = name.toLowerCase();
        return !(!bindings[name] || bindings[name].length === 0);
      }
223275
function has(obj, ...args) {
  if (obj === undefined) {
    return false;
  }

  const keys = Array.prototype.slice.apply(args);
  const length = keys.length;
  let object = obj;

  for (let i = 0; i < length; i++) {
    if (!object || !hasOwnProperty.call(object, keys[i])) {
      return false;
    }

    object = object[keys[i]];
  }

  return true;
}
678893
def has_property(obj, name):
        
        if obj == None:
            raise Exception("Object cannot be null")
        if name == None:
            raise Exception("Property name cannot be null")

        name = name.lower()

        for property_name in dir(obj): 
            if property_name.lower() != name:
                continue

            property = getattr(obj, property_name)

            if PropertyReflector._is_property(property, property_name):
                return True
        
        return False
1012083
def validate_collections(self, model, context=None):
        
        result = Result()
        for property_name in self.collections:
            prop = self.collections[property_name]
            collection = self.get(model, property_name)

            errors = prop.validate(
                value=collection,
                model=model,
                context=context
            )
            if len(errors):
                result.add_collection_errors(
                    property_name=property_name,
                    direct_errors=errors
                )

            collection_errors = prop.validate_with_schema(
                collection=collection,
                context=context
            )

            result.add_collection_errors(
                property_name=property_name,
                collection_errors=collection_errors
            )

        return result
445831
def is_in(property_name, set_values, *, present_optional=False, message=None):
    """"""
    def check(val):
      """Checks that a value is contained within a scope-enclosed set."""
      if val is None:
        return present_optional
      else:
        return val in set_values

    return Validation(check, property_name, message)
587367
def validate (properties):
    
    if isinstance(properties, Property):
        properties = [properties]
    assert is_iterable_typed(properties, Property)
    for p in properties:
        __validate1(p)
1156133
def has_property(self, property_name):
        
        if property_name in self.properties:
            return True
        elif property_name in self.entities:
            return True
        elif property_name in self.collections:
            return True
        else:
            return False