Creates new 'PropertySet' instances after checking
        that all properties are valid and converting implicit
        properties into gristed form.
489311
def create_with_validation (raw_properties):
    
    assert is_iterable_typed(raw_properties, basestring)
    properties = [property.create_from_string(s) for s in raw_properties]
    property.validate(properties)

    return create(properties)
481087
function ProtoSet (defaultValues, opts) {
  var self = this
  self.object = []
  self.sources = []
  self.releases = []
  self.binder = LazyWatcher.call(self, self._update, self._listen, self._unlisten)
  self.binder.value = this.object

  if (opts && opts.nextTick) self.binder.nextTick = true
  if (opts && opts.idle) self.binder.idle = true

  if (defaultValues && defaultValues.length) {
    defaultValues.forEach(function (valueOrObs) {
      if (!~self.sources.indexOf(valueOrObs)) {
        self.sources.push(valueOrObs)
      }
    })
    this._update()
  }
}
132747
private Map<JSType, String> buildPropNames(Property prop) {
    UnionFind<JSType> pTypes = prop.getTypes();
    String pname = prop.name;
    Map<JSType, String> names = new HashMap<>();
    for (Set<JSType> set : pTypes.allEquivalenceClasses()) {
      checkState(!set.isEmpty());
      JSType representative = pTypes.find(set.iterator().next());
      String typeName = null;
      for (JSType type : set) {
        String typeString = type.toString();
        if (typeName == null || typeString.compareTo(typeName) < 0) {
          typeName = typeString;
        }
      }
      String newName;
      if ("{...}".equals(typeName)) {
        newName = pname;
      } else {
        newName = NONWORD_PATTERN.matcher(typeName).replaceAll("_") + '$' + pname;
      }
      names.put(representative, newName);
    }
    return names;
  }
571887
public org.inferred.freebuilder.processor.property.Property build() {
    Preconditions.checkState(_unsetProperties.isEmpty(), "Not set: %s", _unsetProperties);
    return new Value(this);
  }
813792
private MultiValuedMap<String,VarBindingDef> createPropertyProviders( FunctionInputDef inputDef)
    {
    propertyProviders_ = MultiMapUtils.newListValuedHashMap();
    for( VarDefIterator varDefs = new VarDefIterator( inputDef.getVarDefs()); varDefs.hasNext(); )
      {
      VarDef varDef = varDefs.next();
      for( Iterator<VarValueDef> values = varDef.getValidValues(); values.hasNext(); )
        {
        VarValueDef value = values.next();
        if( value.hasProperties())
          {
          VarBindingDef binding = new VarBindingDef( varDef, value);
          for( Iterator<String> properties = value.getProperties().iterator(); properties.hasNext(); )
            {
            propertyProviders_.put( properties.next(), binding);
            }
          }
        }
      }

    return propertyProviders_;
    }
834630
def _initilize_props(self):
        
        # if self.subject == "pyuri_aHR0cDovL3R1dHQuZWR1Lw==_":
        #     pdb.set_trace()
        try:
            # pdb.set_trace()
            for prop in self.es_props:
                self[prop] = self.properties[prop](self, self.dataset)
                setattr(self, prop, self[prop])

            self[__a__] = self.properties[__a__](self, self.dataset)
            setattr(self, __a__, self[__a__])
            # for prop, prop_class in self.properties.items():
            #     # passing in the current dataset tie
            #     self[prop] = prop_class(self, self.dataset)
            #     setattr(self, prop, self[prop])
            # bases = remove_parents((self.__class__,) +
            #                         self.__class__.__bases__)
            # for base in bases:
            #     if base.__name__ not in IGNORE_CLASSES:
            #         base_name = Uri(base.__name__)
            #         try:
            #             self['rdf_type'].append(base_name)
            #         except KeyError:
            #             self[Uri('rdf_type')] = MODULE.rdfclass.make_property({},
            #                     'rdf_type',
            #                     self.__class__.__name__)(self, self.dataset)
            #             self['rdf_type'].append(base_name)
        except (AttributeError, TypeError):
            pass
1174231
private <T> Set<? extends T> create(Iterable<Class<? extends T>> types)
	{
		Set<T> result = new HashSet<>();

		for(Class<? extends T> t : types)
		{
			if(! Modifier.isAbstract(t.getModifiers()) && ! t.isInterface())
			{
				T instance = factory.create(t);
				result.add(instance);
			}
		}

		return Collections.unmodifiableSet(result);
	}
665467
@Override
	public void afterPropertiesSet() {

		this.urlRewriter = new CssImageUrlRewriter(config);
		cssSkinResolver = (AbstractCssSkinVariantResolver) config.getGeneratorRegistry()
				.getVariantResolver(JawrConstant.SKIN_VARIANT_TYPE);
		if (cssSkinResolver == null) {
			cssSkinResolver = new CssSkinVariantResolver();
			config.getGeneratorRegistry().registerVariantResolver(cssSkinResolver);
		}

		// Init skin mapping
		String cfgSkinMappingType = config.getProperty(JawrConstant.SKIN_TYPE_MAPPING_CONFIG_PARAM);
		if (StringUtils.isNotEmpty(cfgSkinMappingType)) {
			if (cfgSkinMappingType.equals(JawrConstant.SKIN_TYPE_MAPPING_LOCALE_SKIN)
					|| cfgSkinMappingType.equals(JawrConstant.SKIN_TYPE_MAPPING_SKIN_LOCALE)) {
				this.skinMappingType = cfgSkinMappingType;
			} else {
				throw new IllegalArgumentException(
						"The value for the '" + JawrConstant.SKIN_TYPE_MAPPING_LOCALE_SKIN + "' " + "property ["
								+ cfgSkinMappingType + "] is invalid. " + "Please check the docs for valid values ");
			}
		}
		this.skinMapping = getSkinMapping(rsBrowser, config);
		resourceProviderStrategyClass = CssSkinVariantResourceProviderStrategy.class;

	}
604277
def construct_formset(self):
        
        if not self.inline_model or not self.parent_model:
            msg = "Parent and Inline models are required in {}".format(self.__class__.__name__)
            raise NotModelException(msg)

        return inlineformset_factory(
            self.parent_model,
            self.inline_model,
            **self.get_factory_kwargs())
329061
function createSets() {
        self.indoorSet = new self.StoogeSet();
        self.indoorSet.set('name', 'indoor');
        self.desertSet = new self.StoogeSet();
        self.desertSet.set('name', 'desert');
        spec.integrationStore.putModel(self.indoorSet, function (model, error) {
          if (typeof error != 'undefined') {
            callback(error);
          } else {
            spec.integrationStore.putModel(self.desertSet, function (model, error) {
              if (typeof error != 'undefined') {
                callback(error);
              } else {
                createLines();
              }
            });
          }
        });
      }
679605
def refine (properties, requirements):
    
    assert is_iterable_typed(properties, Property)
    assert is_iterable_typed(requirements, Property)
    # The result has no duplicates, so we store it in a set
    result = set()

    # Records all requirements.
    required = {}

    # All the elements of requirements should be present in the result
    # Record them so that we can handle 'properties'.
    for r in requirements:
        # Don't consider conditional requirements.
        if not r.condition:
            required[r.feature] = r

    for p in properties:
        # Skip conditional properties
        if p.condition:
            result.add(p)
        # No processing for free properties
        elif p.feature.free:
            result.add(p)
        else:
            if p.feature in required:
                result.add(required[p.feature])
            else:
                result.add(p)

    return sequence.unique(list(result) + requirements)
1085461
def SetProperties(has_props_cls, input_dict, include_immutable=True):
    """"""
    props = has_props_cls()
    if not isinstance(input_dict, (dict, collections.OrderedDict)):
        raise RuntimeError('input_dict invalid: ', input_dict)
    for k, v in iter(input_dict.items()):
        if (k in has_props_cls._props and (
                include_immutable or
                any(hasattr(has_props_cls._props[k], att) for att in ('required', 'new_name'))
                )
           ):
            p = props._props.get(k)
            if isinstance(p, properties.HasProperties):
                props._set(k, SetProperties(p, v, include_immutable=include_immutable))
            elif isinstance(p, properties.Instance):
                props._set(k, SetProperties(p.instance_class, v, include_immutable=include_immutable))
            elif isinstance(p, properties.List):
                if not isinstance(v, list):
                    raise RuntimeError('property value mismatch', p, v)
                if not isinstance(v[0], properties.HasProperties):
                    prop = p.prop.instance_class
                    newlist = []
                    for i in v:
                        value = SetProperties(prop, i, include_immutable=include_immutable)
                        newlist.append(value)
                    props._set(k, newlist)
                else:
                    props._set(k, v)
            else:
                props._set(k, p.from_json(v))

    # Return others as well
    # others_dict = {k: v for k, v in iter(input_dict.items())
    #                if k not in has_props_cls._props}
    return props
785345
function set(target, propertyKey, V /* , receiver */) {
  var receiver = arguments.length < 4 ? target : arguments[3];
  var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
  var existingDescriptor, prototype;
  if (!ownDescriptor) {
    if (isObject(prototype = getPrototypeOf(target))) {
      return set(prototype, propertyKey, V, receiver);
    }
    ownDescriptor = createPropertyDescriptor(0);
  }
  if (has(ownDescriptor, 'value')) {
    if (ownDescriptor.writable === false || !isObject(receiver)) return false;
    if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
      if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
      existingDescriptor.value = V;
      definePropertyModule.f(receiver, propertyKey, existingDescriptor);
    } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
    return true;
  }
  return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true);
}
1345837
void recomposeAttributeSets(ElemAttributeSet attrSet)
  {
    ArrayList attrSetList = (ArrayList) m_attrSets.get(attrSet.getName());

    if (null == attrSetList)
    {
      attrSetList = new ArrayList();

      m_attrSets.put(attrSet.getName(), attrSetList);
    }

    attrSetList.add(attrSet);
  }
1329214
final ImmutableBiMap<String, ExecutableElement> propertyNameToMethodMap(
      Set<ExecutableElement> propertyMethods) {
    Map<String, ExecutableElement> map = new LinkedHashMap<>();
    Set<String> reportedDups = new HashSet<>();
    boolean allPrefixed = gettersAllPrefixed(propertyMethods);
    for (ExecutableElement method : propertyMethods) {
      String methodName = method.getSimpleName().toString();
      String name = allPrefixed ? nameWithoutPrefix(methodName) : methodName;
      ExecutableElement old = map.put(name, method);
      if (old != null) {
        String message = "More than one @" + simpleAnnotationName + " property called " + name;
        errorReporter.reportError(message, method);
        if (reportedDups.add(name)) {
          errorReporter.reportError(message, old);
        }
      }
    }
    return ImmutableBiMap.copyOf(map);
  }
869220
function createGettersAndSetters() {
        var editor = EditorManager.getActiveEditor();
        if (!editor) {
            return;
        }
        initializeRefactoringSession(editor);

        var startIndex = current.startIndex,
            endIndex = current.endIndex,
            selectedText = current.selectedText;

        if (selectedText.length >= 1) {
            var selectionDetails = RefactoringUtils.normalizeText(selectedText, startIndex, endIndex);
            selectedText = selectionDetails.text;
            startIndex = selectionDetails.start;
            endIndex = selectionDetails.end;
        }

        var token = TokenUtils.getTokenAt(current.cm, current.cm.posFromIndex(endIndex)),
            commaString = ",",
            isLastNode,
            templateParams,
            parentNode,
            propertyEndPos;

        //Create getters and setters only if selected reference is a property
        if (token.type !== "property") {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }

        parentNode = current.getParentNode(current.ast, endIndex);
        // Check if selected propery is child of a object expression
        if (!parentNode || !parentNode.properties) {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }


        var propertyNodeArray = parentNode.properties;
        // Find the last Propery Node before endIndex
        var properyNodeIndex = propertyNodeArray.findIndex(function (element) {
            return (endIndex >= element.start && endIndex < element.end);
        });

        var propertyNode = propertyNodeArray[properyNodeIndex];

        //Get Current Selected Property End Index;
        propertyEndPos = editor.posFromIndex(propertyNode.end);


        //We have to add ',' so we need to find position of current property selected
        isLastNode = current.isLastNodeInScope(current.ast, endIndex);
        var nextPropertNode, nextPropertyStartPos;
        if(!isLastNode && properyNodeIndex + 1 <= propertyNodeArray.length - 1) {
            nextPropertNode = propertyNodeArray[properyNodeIndex + 1];
            nextPropertyStartPos = editor.posFromIndex(nextPropertNode.start);

            if(propertyEndPos.line !== nextPropertyStartPos.line) {
                propertyEndPos = current.lineEndPosition(current.startPos.line);
            } else {
                propertyEndPos = nextPropertyStartPos;
                commaString = ", ";
            }
        }

        var getSetPos;
        if (isLastNode) {
            getSetPos = current.document.adjustPosForChange(propertyEndPos, commaString.split("\n"),
                                                            propertyEndPos, propertyEndPos);
        } else {
            getSetPos = propertyEndPos;
        }
        templateParams = {
            "getName": token.string,
            "setName": token.string,
            "tokenName": token.string
        };

        // Replace, setSelection, IndentLine
        // We need to call batchOperation as indentLine don't have option to add origin as like replaceRange
        current.document.batchOperation(function() {
            if (isLastNode) {
                //Add ',' in the end of current line
                current.document.replaceRange(commaString, propertyEndPos, propertyEndPos);
            }

            current.editor.setSelection(getSetPos); //Selection on line end

            // Add getters and setters for given token using template at current cursor position
            current.replaceTextFromTemplate(GETTERS_SETTERS, templateParams);

            if (!isLastNode) {
                // Add ',' at the end setter
                current.document.replaceRange(commaString, current.editor.getSelection().start, current.editor.getSelection().start);
            }
        });
    }
485516
protected function initElements()
    {
        
        $property = $this->getPropertyInstance();

	    $index = $this->getIndex();

	    $propertyProperties = array_merge(
			tao_helpers_form_GenerisFormFactory::getDefaultProperties(), 
			array(new core_kernel_classes_Property(GenerisRdf::PROPERTY_IS_LG_DEPENDENT),
                new core_kernel_classes_Property(TaoOntology::PROPERTY_GUI_ORDER),
                $this->getProperty(ValidationRuleRegistry::PROPERTY_VALIDATION_RULE)
			)
		);
	    $values = $property->getPropertiesValues($propertyProperties);
    	
    	$elementNames = array();
		foreach($propertyProperties as $propertyProperty){
		
			//map properties widgets to form elements
			$element = tao_helpers_form_GenerisFormFactory::elementMap($propertyProperty);
			
			if(!is_null($element)){
				//take property values to populate the form
				if (isset($values[$propertyProperty->getUri()])) {
				    $propertyValues = $values[$propertyProperty->getUri()];
				    foreach($propertyValues as $value){
				        if(!is_null($value)){
				            if($value instanceof core_kernel_classes_Resource){
				                $element->setValue($value->getUri());
				            }
				            if($value instanceof core_kernel_classes_Literal){
				                $element->setValue((string)$value);
				            }
				        }
				    }
				}
				$element->setName("{$index}_{$element->getName()}");
                $element->addClass('property');

                if ($propertyProperty->getUri() == TaoOntology::PROPERTY_GUI_ORDER){
                    $element->addValidator(tao_helpers_form_FormFactory::getValidator('Integer'));
                }
                if ($propertyProperty->getUri() == OntologyRdfs::RDFS_LABEL){
                    $element->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty'));
                }
				$this->form->addElement($element);
				$elementNames[] = $element->getName();
			}
		}
		
		//build the type list from the "widget/range to type" map
		$typeElt = tao_helpers_form_FormFactory::getElement("{$index}_type", 'Combobox');
		$typeElt->setDescription(__('Type'));
		$typeElt->addAttribute('class', 'property-type property');
		$typeElt->setEmptyOption(' --- '.__('select').' --- ');
		$options = array();
		$checkRange = false;
		foreach(tao_helpers_form_GenerisFormFactory::getPropertyMap() as $typeKey => $map){
			$options[$typeKey] = $map['title'];
            $widget = $property->getWidget();
			if($widget instanceof core_kernel_classes_Resource) {
				if($widget->getUri() == $map['widget']){
					$typeElt->setValue($typeKey);
					$checkRange = is_null($map['range']);
				}
			}
		}
		$typeElt->setOptions($options);
		$this->form->addElement($typeElt);
		$elementNames[] = $typeElt->getName();

	    $range = $property->getRange();

	    $rangeSelect = tao_helpers_form_FormFactory::getElement( "{$this->getIndex()}_range", 'Combobox' );
	    $rangeSelect->setDescription( __( 'List values' ) );
	    $rangeSelect->addAttribute( 'class', 'property-listvalues property' );
	    $rangeSelect->setEmptyOption( ' --- ' . __( 'select' ) . ' --- ' );

	    if ($checkRange) {
		    $rangeSelect->addValidator( tao_helpers_form_FormFactory::getValidator( 'NotEmpty' ) );
	    }

	    $this->form->addElement($rangeSelect);
	    $elementNames[] = $rangeSelect->getName();

	    //list drop down
	    $listElt = $this->getListElement( $range );
		$this->form->addElement($listElt);
		$elementNames[] = $listElt->getName();

	    //trees dropdown
	    $treeElt = $this->getTreeElement( $range );
	    $this->form->addElement($treeElt);
	    $elementNames[] = $treeElt->getName();

	    //index part
        $indexes = $property->getPropertyValues(new \core_kernel_classes_Property(OntologyIndex::PROPERTY_INDEX));
        foreach($indexes as $i => $indexUri){
            $indexProperty = new OntologyIndex($indexUri);
            $indexFormContainer = new tao_actions_form_IndexProperty($indexProperty,$index.$i);
            /** @var tao_helpers_form_Form $indexForm */
            $indexForm = $indexFormContainer->getForm();
            foreach($indexForm->getElements() as $element){
                $this->form->addElement($element);
                $elementNames[] = $element->getName();
            }
        }

        //add this element only when the property is defined (type)
        if(!is_null($property->getRange())){
            $addIndexElt = tao_helpers_form_FormFactory::getElement("index_{$index}_add", 'Free');
            $addIndexElt->setValue(
                "<a href='#' class='btn-info index-adder small index'><span class='icon-add'></span> " . __(
                    'Add index'
                ) . "</a><div class='clearfix'></div>"
            );
            $this->form->addElement($addIndexElt);
            $elementNames[] = $addIndexElt;
        }
        else{
            $addIndexElt = tao_helpers_form_FormFactory::getElement("index_{$index}_p", 'Free');
            $addIndexElt->setValue(
                "<p class='index' >" . __(
                    'Choose a type for your property first'
                ) . "</p>"
            );
            $this->form->addElement($addIndexElt);
            $elementNames[] = $addIndexElt;
        }

        //add an hidden elt for the property uri
        $encodedUri = tao_helpers_Uri::encode($property->getUri());
        $propUriElt = tao_helpers_form_FormFactory::getElement("{$index}_uri", 'Hidden');
        $propUriElt->addAttribute('class', 'property-uri property');
        $propUriElt->setValue($encodedUri);
        $this->form->addElement($propUriElt);
        $elementNames[] = $propUriElt;

		if(count($elementNames) > 0){
			$groupTitle = $this->getGroupTitle($property);
			$this->form->createGroup("property_{$encodedUri}", $groupTitle, $elementNames);
		}

    }