Each property must be in the form:
['propertyName', true | false]

false is ASC (default)
true is DESC
509250
function normalizeProperties(properties) {
  return _.map(properties, function(val) {
    if(_.isString(val)) {
      return [val, false];
    } else if(val.length === 2){
      return [val[0], val[1].toLowerCase() === "desc"];
    } else {
      throw new Error("Wrong format for index definition, ['property name', 'desc'|'asc'] required");
    }
  });
}
333484
def properties= value
      value.each do |k,v|
        self.add_property k.to_s, v
      end
    end
458251
def property name, prop
      return '' if EXCLUDE_PROPERTIES.include?(name.to_s) || prop.nil? || (prop.kind_of?(Array) && prop.empty?)
      
      prop = prop.flatten.map{|p| "'#{p}'"}.join(', ') if prop.respond_to?(:flatten) && name.to_sym != :folders
      prop = @paths.map{|f| "'#{f}'"}.join(',') if name.to_sym == :folders
      
      prop = "'#{prop.exec_rule}'" if prop.instance_of?(Syntaxer::Runner::ExecRule) && !prop.exec_rule.nil?
      prop = "Syntaxer::Runner.#{prop.language}" if prop.instance_of?(Syntaxer::Runner::ExecRule) && prop.exec_rule.nil?
      
      ' '*4 + "#{name.to_s} #{prop}\n"
    end
688096
def _cim_property_decl(key, value):
    

    if key is None:
        raise ValueError("Property name must not be None")

    try:
        assert isinstance(value, CIMProperty)
    except AssertionError:
        raise TypeError(
            _format("Property must be a CIMProperty object, but is: {0}",
                    type(value)))

    if value.name.lower() != key.lower():
        raise ValueError(
            _format("CIMProperty.name must be dictionary key {0!A}, but is "
                    "{1!A}", key, value.name))

    return value
250572
def propertyNames(self):
        
        """
        for k in self.data:
            yield k
        if self.defaults is not None:
            for k in self.defaults.propertyNames():
                if k not in self.data:
                    yield k
1345690
private void checkInvalidClassProperty(String className, String propertyName) {
        if (className != null && propertyName != null) {
            boolean isInvalidCombination = walkInvalidList(className, propertyName, invalidClassProperty);
            if (isInvalidCombination) {
                Tr.error(tc, "DYNA0050E", new Object[] { "'" + propertyName + "'", "'" + className + "'" });
                Tr.error(tc, "dynacache.configerror" /* DYNA0022E */
                         , new Object[] { filename });
            }
        }
    }
602478
def create(cls, propertyfile, allow_unknown):
        
        with open(propertyfile) as f:
            content = f.read().strip()

        # parse content for known properties
        is_svcomp = False
        known_properties = []
        only_known_svcomp_property = True

        if content == 'OBSERVER AUTOMATON' or content == 'SATISFIABLE':
            known_properties = [_PROPERTY_NAMES[content]]

        elif content.startswith('CHECK'):
            is_svcomp = True
            for line in filter(None, content.splitlines()):
                if content.startswith('CHECK'):
                    # SV-COMP property, either a well-known one or a new one
                    props_in_line = [
                        prop for (substring, prop) in _PROPERTY_NAMES.items() if substring in line]
                    if len(props_in_line) == 1:
                        known_properties.append(props_in_line[0])
                    else:
                        only_known_svcomp_property = False
                else:
                    # not actually an SV-COMP property file
                    is_svcomp = False
                    known_properties = []
                    break

        # check if some known property content was found
        subproperties = None
        if only_known_svcomp_property and len(known_properties) == 1:
            is_well_known = True
            name = known_properties[0]

        elif only_known_svcomp_property and set(known_properties) == _MEMSAFETY_SUBPROPERTIES:
            is_well_known = True
            name = _PROP_MEMSAFETY
            subproperties = list(known_properties)

        else:
            if not allow_unknown:
                raise BenchExecException(
                    'File "{0}" does not contain a known property.'.format(propertyfile))
            is_well_known = False
            name = os.path.splitext(os.path.basename(propertyfile))[0]

        return cls(propertyfile, is_well_known, is_svcomp, name, subproperties)
288222
def _property_names(self):
        
        property_names = []

        for name in dir(self):
            try:
                attr = getattr(type(self), name)

                if isinstance(attr, property) or isinstance(attr, cached_property):
                    property_names.append(name)

            except AttributeError:
                pass

        return property_names
311010
private void initAttributesAndElements(String... propertyNames)
        {
        for (String propertyName : propertyNames)
            {
            Property property = new Property(propertyName);
            if (property.isAttribute())
                {
                m_attributes.add(property);
                }
            else
                {
                m_elements.add(property);
                }
            }
        }
793394
def missing_property_names(self):
        

        propname = lambda x: self.__prop_names__[x]
        missing = []
        for x in self.__required__:

            # Allow the null type
            propinfo = self.propinfo(propname(x))
            null_type = False
            if 'type' in propinfo:
                type_info = propinfo['type']
                null_type = (type_info == 'null'
                             or isinstance(type_info, (list, tuple))
                             and 'null' in type_info)
            elif 'oneOf' in propinfo:
                for o in propinfo['oneOf']:
                    type_info = o.get('type')
                    if type_info and type_info == 'null' \
                            or isinstance(type_info, (list, tuple)) \
                            and 'null' in type_info:
                        null_type = True
                        break

            if (propname(x) not in self._properties and null_type) or \
                    (self._properties[propname(x)] is None and not null_type):
                missing.append(x)

        return missing
1118008
def get_form_schema(form):
    """"""
    schema = {
        'type': 'object',
        'properties': {},
    }

    for name, field in form.base_fields.items():
        schema['properties'][name] = get_field_schema(name, field)
        if field.required:
            schema.setdefault('required', []).append(name)

    return schema
245932
def _get_property_values_with_defaults(self, classname, property_values):
        """"""
        # To uphold OrientDB semantics, make a new dict with all property values set
        # to their default values, which are None if no default was set.
        # Then, overwrite its data with the supplied property values.
        final_values = self.get_default_property_values(classname)
        final_values.update(property_values)
        return final_values
812320
function(items, propertyName) {
        if(!items) return false;

        var hasProperty = true;
        for(var i = 0; i < items.length; i++) {
            if(isNaN(items[i][propertyName]))
                hasProperty = false;
        }
        return hasProperty;
    }
340084
def validate_properties_exist(self, classname, property_names):
        """"""
        schema_element = self.get_element_by_class_name(classname)

        requested_properties = set(property_names)
        available_properties = set(schema_element.properties.keys())
        non_existent_properties = requested_properties - available_properties
        if non_existent_properties:
            raise InvalidPropertyError(
                u'Class "{}" does not have definitions for properties "{}": '
                u'{}'.format(classname, non_existent_properties, property_names))
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))
709600
def _validate_property_names(class_name, properties):
    """"""
    for property_name in properties:
        if not property_name or property_name.startswith(ILLEGAL_PROPERTY_NAME_PREFIXES):
            raise IllegalSchemaStateError(u'Class "{}" has a property with an illegal name: '
                                          u'{}'.format(class_name, property_name))
333520
function validatePropertyConfig(property) {  
  /** If name is missing or not a string, throw error */
  if ( typeof property.name !== 'string' )
    throw new Error(`ezobjects.validatePropertyConfig(): Property configured with missing or invalid 'name'.`);

  /** If type is missing or not a string, throw error */
  if ( typeof property.type !== 'string' && typeof property.instanceOf !== 'string' )
    throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' configured with missing or invalid 'type' and/or 'instanceOf', one of them is required.`);
  
  /** If the original type has not yet been recorded */
  if ( property.type && typeof property.originalType !== 'string' ) {
    /** Store original type with preserved case */
    property.originalType = property.type;
    
    /** Convert type to lower-case for comparison to ezobjectsTypes */
    property.type = property.type.toLowerCase();
  }
  
  /** Attach arrayOf 'ezobjectType' if property type is 'array' */
  if ( property.type == 'array' ) {
    /** If type is 'ARRAY' with no 'arrayOf', throw error */
    if ( typeof property.arrayOf !== 'object' || property.arrayOf.constructor.name != 'Object' )
      throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' of type ${property.type} with missing or invalid 'arrayOf'.`);

    /** If type is 'ARRAY' with 'arrayOf' containing bad or missing type, throw error */
    if ( typeof property.arrayOf.type != 'string' && typeof property.arrayOf.instanceOf != 'string' )
      throw new Error(`ezobjects.validatePropertyConfig(): Property '${property.name}' of type ${property.type} with missing or invalid 'arrayOf.type' and/or 'arrayOf.instanceOf', one of them is required.`);

    /** If it's a standard EZ Object type, attach 'ezobjectType' to property for later use */
    property.ezobjectType = ezobjectTypes.find(x => x.type == property.type && x.arrayOfType == property.arrayOf.type );

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.ezobjectType )
      property.ezobjectType = ezobjectTypes.find(x => x.type == 'array' && x.arrayOfType == 'other' );
    
    /** If it's a standard EZ Object type, attach 'ezobjectType' to property arrayOf type for later use */
    property.arrayOf.ezobjectType = ezobjectTypes.find(x => x.type == property.arrayOf.type);

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.arrayOf.ezobjectType )
      property.arrayOf.ezobjectType = ezobjectTypes.find(x => x.type == 'other');
    
    /** Fully determine whether to allow nulls for this property */
    if ( typeof property.arrayOf.allowNull !== `boolean` && property.arrayOf.ezobjectType.type != 'other' )
      property.arrayOf.allowNull = false;
    else if ( typeof property.arrayOf.allowNull !== `boolean` )
      property.arrayOf.allowNull = true;
  } else {
    /** If it's a standard EZ Object type, attach 'ezobjectType' to property for later use */
    property.ezobjectType = ezobjectTypes.find(x => x.type == property.type);

    /** If no standard type was found, use 'other' type for other objects */
    if ( !property.ezobjectType )
      property.ezobjectType = ezobjectTypes.find(x => x.type == 'other');
  }
  
  /** Create default transform function that doesn't change the input */
  const defaultTransform = x => x;
  
  /** If there is no setter transform, set to default */
  if ( typeof property.setTransform !== `function` )
    property.setTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.setTransform == 'function' ? property.ezobjectType.setTransform : defaultTransform;

  /** If there is no save transform, set to default */
  if ( typeof property.saveTransform !== `function` )
    property.saveTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.saveTransform == 'function' ? property.ezobjectType.saveTransform : defaultTransform;

  /** If there is no load transform, set to default */
  if ( typeof property.loadTransform !== `function` )
    property.loadTransform = typeof property.ezobjectType == 'object' && typeof property.ezobjectType.loadTransform == 'function' ? property.ezobjectType.loadTransform : defaultTransform;
      
  /** Fully determine whether to allow nulls for this property */
  if ( typeof property.allowNull !== `boolean` && property.ezobjectType.type != 'other' )
    property.allowNull = false;
  else if ( typeof property.allowNull !== `boolean` )
    property.allowNull = true;
}