Sets node attribute. Can be customized by attr_setter property
493568
def set_attr(self, key: str, value):
        """"""
        self.attr_setter(self, key, value)
180488
def set_attr(self, name: str, values: np.ndarray, axis: int = 0, dtype: str = None) -> None:
		
		deprecated("'set_attr' is deprecated. Use 'ds.ra.key = values' or 'ds.ca.key = values' instead")
		if axis == 0:
			self.ra[name] = values
		else:
			self.ca[name] = values
784
def setattrdeep(obj, attr, val):
    ''
    attrs = attr.split('.')

    for a in attrs[:-1]:
        obj = getattr(obj, a)
    setattr(obj, attrs[-1], val)
1225730
function(elem, attr) {
		// for each attributeName
		for (var name in attr) {
			if (attr.hasOwnProperty(name)) {
				// attributes
				elem.setAttribute(name, attr[name]);
			}
		}
		return elem;
	}
1256114
function set_attribute($name, $value){
		switch($name){
			case "id": 
				$this->set_id($value);
				break;
			case "text": 
				$this->data[$this->config->text[0]["name"]]=$value;
				break;
			case "checked": 
				$this->set_check_state($value);
				break;
			case "im0": 
				$this->im0=$value;
				break;
			case "im1": 
				$this->im1=$value;
				break;
			case "im2": 
				$this->im2=$value;
				break;
			case "child": 
				$this->set_kids($value);
				break;
			default:
				$this->attrs[$name]=$value;
		}
	}
409013
def _set_attribute(self, name, value):
        """"""
        setattr(self, name, value)
        self.namespace.update({name: getattr(self, name)})
1310921
def _set_attrs(self, attrs, allow_ro=False, from_json=True):
    
    for k, v in attrs.iteritems():
      attr = self._check_attr(k, allow_ro)
      if attr and from_json:
        v = attr.from_json(self._get_resource_root(), v)
      object.__setattr__(self, k, v)
464045
def attribute(*args)
      node = Nodes::Attribute.new

      if args.first.is_a?(Hash)
        args.first.each_pair { |k, v| node[v] = k }
      else
        options = args.extract_options!
        args.each { |name|
          key = options[:as] || name
          node[key] = name
        }
        node.condition = options[:if]
      end

      @template.add_node node
    end
726466
def set_attributes(self, **attributes):
        

        auto_set = IxeObject.get_auto_set()
        IxeObject.set_auto_set(False)
        for name, value in attributes.items():
            setattr(self, name, value)
        if auto_set:
            self.ix_set()
        IxeObject.set_auto_set(auto_set)
1053019
public BaseBo setAttribute(String attrName, Object value) {
        return setAttribute(attrName, value, true);
    }
562922
public void setItemAttribute(TreeHtmlAttributeInfo attr)
    {
        _child = true;
        if (_attributes == null)
            _attributes = new ArrayList();
        _attributes.add(attr);
    }
257292
def _set_attrib(name, key, value, param, root=None, validate=True):
    '''
    
    '''
    pre_info = info(name, root=root)

    # If the user is not present or the attribute is already present,
    # we return early
    if not pre_info['name']:
        return False

    if value == pre_info[key]:
        return True

    cmd = ['chage']

    if root is not None:
        cmd.extend(('-R', root))

    cmd.extend((param, value, name))

    ret = not __salt__['cmd.run'](cmd, python_shell=False)
    if validate:
        ret = info(name, root=root).get(key) == value
    return ret
992751
def apply_attribute(node: Node, attr: XmlAttr):
    """"""
    setter = get_setter(attr)
    stripped_value = attr.value.strip() if attr.value else ''
    if is_expression(stripped_value):
        (binding_type, expr_body) = parse_expression(stripped_value)
        binder().apply(binding_type, node=node, attr=attr, modifier=setter, expr_body=expr_body)
    else:
        setter(node, attr.name, attr.value)
906300
def set_attr(self, attr, value, selection=None):
        """"""

        if selection is None:
            selection = self.grid.selection

        if not selection:
            # Add current cell to selection so that it gets changed
            selection.cells.append(self.grid.actions.cursor[:2])

        attrs = {attr: value}

        table = self.grid.current_table

        # Change model
        self._set_cell_attr(selection, table, attrs)
230078
def set_nested_attribute(obj, attribute, value):
    
    parent, attr = resolve_nested_attribute(obj, attribute)
    if parent is None:
        raise AttributeError('Can not set attribute "%s" on None value.'
                             % attr)
    setattr(parent, attr, value)
735918
def visit_attribute(self, node, parent):
        """"""
        context = self._get_context(node)
        if context == astroid.Del:
            # FIXME : maybe we should reintroduce and visit_delattr ?
            # for instance, deactivating assign_ctx
            newnode = nodes.DelAttr(node.attr, node.lineno, node.col_offset, parent)
        elif context == astroid.Store:
            newnode = nodes.AssignAttr(node.attr, node.lineno, node.col_offset, parent)
            # Prohibit a local save if we are in an ExceptHandler.
            if not isinstance(parent, astroid.ExceptHandler):
                self._delayed_assattr.append(newnode)
        else:
            newnode = nodes.Attribute(node.attr, node.lineno, node.col_offset, parent)
        newnode.postinit(self.visit(node.value, newnode))
        return newnode
672584
def toggle_attr(self, attr):
        """"""

        selection = self.grid.selection

        # Selection or single cell access?

        if selection:
            value = self.get_new_selection_attr_state(selection, attr)

        else:
            value = self.get_new_cell_attr_state(self.grid.actions.cursor,
                                                 attr)

        # Set the toggled value

        self.set_attr(attr, value)