Apply attribute conditions
506960
protected function applyFieldConditions()
    {
        if ($this->field !== null) {
            $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));
        }
    }
1112066
function(attributes, options) {
    var attrs = attributes || {};
    options || (options = {});
    this.cid = _.uniqueId('c');
    this.attributes = {};
    if (options.collection) this.collection = options.collection;
    if (options.parse) attrs = this.parse(attrs, options) || {};
    this._schema = this.schema();
    this._defaults = this.defaults(undefined, true);
    attrs = _.defaultsDeep({}, attrs, this.defaults(undefined, false));
    this.set(attrs, options);
    this.changed = {};
    this.initialize.apply(this, arguments);
  }
323996
public void setAttributes (Attributes atts)
    {
        clear();
        length = atts.getLength();
        if (length > 0) {
            data = new String[length*5];
            for (int i = 0; i < length; i++) {
                data[i*5] = atts.getURI(i);
                data[i*5+1] = atts.getLocalName(i);
                data[i*5+2] = atts.getQName(i);
                data[i*5+3] = atts.getType(i);
                data[i*5+4] = atts.getValue(i);
            }
    }
    }
1172428
def has_attribute(module_name, attribute_name):
    """"""
    init_file = '%s/__init__.py' % module_name
    return any(
        [attribute_name in init_line for init_line in open(init_file).readlines()]
    )
729751
function optimizeAttributes(attrs) {
		// clone all attributes to make sure that original objects are 
		// not modified
		attrs = attrs.map(function(attr) {
			return utils.clone(attr);
		});
		
		var lookup = {};

		return attrs.filter(function(attr) {
			if (!(attr.name in lookup)) {
				return lookup[attr.name] = attr;
			}
			
			var la = lookup[attr.name];
			
			if (attr.name.toLowerCase() == 'class') {
				la.value += (la.value.length ? ' ' : '') + attr.value;
			} else {
				la.value = attr.value;
				la.isImplied = !!attr.isImplied;
			}
			
			return false;
		});
	}
1247716
def update_attributes(self, **kwargs):
        """"""
        attrs = self.attributes.values() + self.lists.values() \
                + self.references.values()
        for att in attrs:
            if att.name in kwargs:
                att.__set__(self, kwargs[att.name])
203606
function _setAttributes(el, attrs) {
  Object.keys(attrs).forEach((key) => {
    el.setAttribute(key, attrs[key]);
  });
}
374977
def set_attributes(self, attributes):
        
        for k, v in attributes.items():
            self.set_attribute(k, v)
827514
def _checkAttribs(self, strict):
        """"""
        if self.min:
            warning("Minimum value not allowed for boolean-type parameter " +
                    self.name, strict)
            self.min = None
        if self.max:
            if not self.prompt:
                warning("Maximum value not allowed for boolean-type parameter " +
                                self.name + " (probably missing comma)",
                                strict)
                # try to recover by assuming max string is prompt
                self.prompt = self.max
            else:
                warning("Maximum value not allowed for boolean-type parameter " +
                        self.name, strict)
            self.max = None
        if self.choice:
            warning("Choice values not allowed for boolean-type parameter " +
                    self.name, strict)
            self.choice = None
542829
def apply(self):
        ''' 
        '''
        bus = self.case.buses[int(self.bus_lb.curselection()[0])]

        for attr in [a for a in BUS_ATTRS if a not in self.excluded+['mode']]:
            value = getattr(self.bus_params, attr).get()
            setattr(bus, attr, value)
362886
private boolean attributeValuesMatch(Set attributes, int runIndex1, int runIndex2) {
        Iterator iterator = attributes.iterator();
        while (iterator.hasNext()) {
            Attribute key = (Attribute) iterator.next();
           if (!valuesMatch(getAttribute(key, runIndex1), getAttribute(key, runIndex2))) {
                return false;
            }
        }
        return true;
    }
824290
function (attributes) {
                var attrBinding = this._attributesBinding;
                if (attrBinding) {
                    this.__json.setValue(attrBinding.inside, attrBinding.to, attributes);
                } else {
                    this._applyNewAttributes(attributes);
                }
            }
178793
def set_attribute(self, name, value):
        """"""
        self.attribute_name = name
        self.attribute = value
278198
protected function applyRootCondition(&$condition)
    {
        if (false !== $this->rootAttribute) {
            $condition[] = [$this->rootAttribute => $this->node->{$this->rootAttribute}];
        }
    }
1044160
def condition(*args, **kwds):
  
  if len(args) == 1 and len(kwds) == 0 and callable(args[0]):
    # used as `@decorator`
    func = args[0]
    return wraps(func)(FontBakeryCondition(func))
  else:
    # used as `@decorator()` maybe with args
    def wrapper(func):
      return wraps(func)(FontBakeryCondition(func, *args, **kwds))
  return wrapper
317807
def conditions_to_fields(conditions)
      conditions.inject({}) do |fields, (key, value)|
        fields.merge(key => value)
      end
    end
339745
protected function applyElementConditions()
    {
        if ($this->element !== null) {
            $this->andWhere(Db::parseParam('elementId', $this->parseElementValue($this->element)));
        }
    }