Add a node by form name and value with optional props.

        Args:
            name (str): The form of node to add.
            valu (obj): The value for the node.
            props (dict): Optional secondary properties for the node.
541523
async def addNode(self, name, valu, props=None):
        '''
        
        '''

        try:

            fnib = self._getNodeFnib(name, valu)
            retn = await self._addNodeFnib(fnib, props=props)
            return retn

        except asyncio.CancelledError:
            raise

        except Exception:

            mesg = f'Error adding node: {name} {valu!r} {props!r}'
            logger.exception(mesg)
            if self.strict:
                raise

            return None
549404
def add_variable(self, node):
        
        if node.name not in self.variable_names:
            self.variables.append(node)
            self.variable_names.add(node.name)
            node.parent = self
616289
def setVal(self, name, val):
        
        if self._autoFixNames:
            name = self._fixName(name)
        self._fieldValDict[name] = val
893395
def add_native_name(self, name):
        
        self._ensure_field('name', {})
        self.obj['name'].setdefault('native_names', []).append(name)
782571
def add_tag(self, name, value):
        

        self.tags.append(Tag(name, value))
1073095
def add_field(cls, name, descriptor):
        
        if not isinstance(descriptor, MediaField):
            raise ValueError(
                u'{0} must be an instance of MediaField'.format(descriptor))
        if name in cls.__dict__:
            raise ValueError(
                u'property "{0}" already exists on MediaField'.format(name))
        setattr(cls, name, descriptor)
909593
def add_field(self, name, data):
        
        if name in self._fields:
            raise ValueError
        if not len(data) == self._num_fix:
            raise ValueError
        self._fields.append(name)
        self.__dict__[name] = data
776349
def add_node(self, name_base, attrs=None):
        """"""
        if name_base not in self.counters:
            node_id = name_base
        else:
            node_id = '%s_%d' % (name_base, self.counters[name_base])
        node = {'id': node_id}
        if attrs:
            node['attrs'] = attrs
        self.nodes.append(node)
        self.counters[node_id] += 1
        return node_id
627885
def put_attributes(self, attrs):
        
        assert(isinstance(attrs, dict)), "Argument must be a dict of key->values to save"
        for prop_name in attrs:
            value = attrs[prop_name]
            prop = self.find_property(prop_name)
            assert(prop), "Property not found: %s" % prop_name
            self._manager.set_property(prop, self, prop_name, value)
        self.reload()
        return self
455526
def newNsProp(self, node, name, value):
        
        if node is None: node__o = None
        else: node__o = node._o
        ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
        if ret is None:raise treeError('xmlNewNsProp() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp
1356961
def addObject(self, pairs, name=None):
    
    if name is None:
      name = len(self.objects)

    self.objects[name] = pairs
635191
def _add_attribute(self, name, value, allowed_values=None):
        """"""
        if value and value != 'none':

            if isinstance(value, (int, bool)):
                value = str(value)

            if allowed_values and value not in allowed_values:
                raise TypeError(
                    "Attribute '" + name + "' must be one of " + str(
                        allowed_values) + " but is '" + str(value) + "'")

            self.element_attrs[name] = value
1313120
def _getNodeFnib(self, name, valu):
        '''
        
        '''
        form = self.model.form(name)
        if form is None:
            raise s_exc.NoSuchForm(name=name)

        try:
            norm, info = form.type.norm(valu)
        except Exception as e:
            raise s_exc.BadPropValu(prop=form.name, valu=valu, mesg=str(e))

        buid = s_common.buid((form.name, norm))
        return form, norm, info, buid
933231
def add(cls, name, value):
        """"""
        attr = cls(value)
        attr._name = name
        setattr(cls, name, attr)
558490
def _set_bool_prop(self, name, value):
        
        rPr = self._element.get_or_add_rPr()
        rPr._set_bool_val(name, value)
1065266
function addAttribute(name,value) {
    // Make sure there isn't already an attribute with this name
    // If there is, ignore this one.
    for(var i = 0; i < attributes.length; i++) {
      if (attributes[i][0] === name) return;
    }

    if (value !== undefined) {
      attributes.push([name, value]);
    }
    else {
      attributes.push([name]);
    }
  }
497568
public void addProperty(String name, String value, int valueIndex) {
        if(name == null || name.isEmpty()) {
            throw new IllegalArgumentException("Invalid property name: " + name);
        }
        if(value == null || value.isEmpty()) {
            throw new IllegalArgumentException("Invalid property value: " + value);
        }
        if(props == null) {
            props = new HashMap<String,String>();
        }
        props.put(name, value);
        this.lastPropertyName = name;
        this.lastPropertyValue = value;
        this.lastChunkIndex = valueIndex;
        separator = -1;
    }