supports adding variables to the xml

        Parameters
        ---------------
        var: The SubElement variable
        tag: The SubElement tag to which enum value is to be added

        Return
        ---------------
        None
960774
def _add_value_enum(self, var, tag):
        
        if var['ValueEnum'][0] == 's0':
                numvalues_tag = etree.SubElement(tag, 'NumValues')
                numvalues_tag.text = str(int(var['ValueEnum'][-1][-1]) + 1)
        else:
            valueenum_tag = etree.SubElement(tag, 'ValueEnum')
            valueenum_tag.text = ''
            for value in var['ValueEnum']:
                valueenum_tag.text += value + ' '
            valueenum_tag.text = valueenum_tag.text[:-1]
1256287
def _parse_var(self, element):
        
        syntax = 'attribute' if element.get('name') else 'element'

        var_type = attribute(element, 'type', 'user')
        if syntax == 'attribute':
            var_name  = attribute(element, 'name')
            var_value   = self.agentml.parse_tags(element, self.trigger) if len(element) else element.text
        else:
            name_etree = element.find('name')
            var_name   = self.agentml.parse_tags(name_etree, self.trigger) if len(name_etree) else name_etree.text

            value_etree = element.find('value')
            var_value = self.agentml.parse_tags(value_etree, self.trigger) if len(value_etree) else value_etree.text

        self.vars.append((var_type, var_name, var_value))
96405
def add_flag(var, flag):
    
    if var:
        var = flag + " " + str(var)
    else:
        var = ""
    return var
171955
def addVariantOld(self,
                      literal='',
                      sense=0,
                      gloss='',
                      examples=[]):
        '''

        '''
        var = Variant(literal=literal,
                      sense=sense,
                      gloss=gloss,
                      examples=examples)
        self.variants.append(var)
1309976
@Override
  public ServerEvaluationCall addVariableAs(String name, Object value) {
    if (value == null) return this;

    Class<?> as = value.getClass();
    AbstractWriteHandle writeHandle = null;
    if (AbstractWriteHandle.class.isAssignableFrom(as)) {
      writeHandle = (AbstractWriteHandle) value;
    } else {
      ContentHandle<?> contentHandle = handleRegistry.makeHandle(as);
      Utilities.setHandleContent(contentHandle, value);
      writeHandle = contentHandle;
    }
    return addVariable(name, writeHandle);
  }
741618
def _handle_ignores(testtag):
    
    if "ignores" in testtag.attrib:
        from xml.etree.ElementTree import Element
        for varname in re.split("[\s,]+", testtag.attrib["ignores"]):
            #For ignored variables, the order does not matter. However,
            #if the user included the caret, just remove it.
            if varname[0] == '^':
                varname = varname[1::]
            e = Element("global", {"name": varname, "ignore": "true"})
            testtag.append(e)
475136
private void addInjectedVariable(VariableElement element, String fieldName) {
    TypeName typeName = resolveVariableTypeName(element, messager);

    // Create field
    FieldSpec.Builder fieldBuilder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC);

    // Copy field annotations
    element
        .getAnnotationMirrors()
        .stream()
        .map(AnnotationSpec::get)
        .forEach(fieldBuilder::addAnnotation);

    // If the variable element is a method parameter, it might not have the Inject annotation
    if (!hasInjectAnnotation(element)) {
      fieldBuilder.addAnnotation(Inject.class);
    }

    // And add field
    builder.addField(fieldBuilder.build());
  }
750667
def add(self, **kwargs):
        
        for name, var in kwargs.items():
            if iskeyword(name):
                var['name'] = name
                name = '_' + name
            if name in self:
                self[name] = merge(self[name], Variable(self.default_type, **var))
            else:
                self[name] = Variable(self.default_type, **var)
        return self
1369372
private final void addVariableValue(String value, String variableName) {
		if (StringUtils.isNotEmpty(variableName)) {
			JMeterVariables vars = getVariables();
			if (vars != null) {
				vars.put(variableName, value);
			}
		}
	}
1184408
@Override
    @SuppressWarnings("unchecked")
    public <T> Variable<T> getVariable(final String variableName) {
        final String[] subTokens = getSubVariableTokens(variableName);
        if (subTokens != null) {
            final Variable<T> sub = getSubVariable(subTokens[0], subTokens[1]);
            if (sub != null) {
                return sub;
            }
        }
        final Variable<T> v;
        synchronized (variables) {
            v = variables.get(variableName);
        }
        return v;
    }
1286248
private void addElement(String key, String value) {
        this.num_items++;
        List<String> vals = this.values.get(key);
        if (null == vals) {
            vals = new LinkedList<String>();
        }
        if (null == value) {
            vals.add("\"\"");
        } else {
            vals.add(value);
        }
        this.values.put(key, vals);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addElement: " + key + "=" + value + " num: " + this.num_items);
        }
    }
1021168
public void buildTagInfo(XMLNode node, Content enumConstantsTree) {
        writer.addTags(
                (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
                enumConstantsTree);
    }
782571
def add_tag(self, name, value):
        

        self.tags.append(Tag(name, value))
168542
@Override
	protected void putVariables(Map<String, String> variables) {
		variables.put(ScopeFormat.SCOPE_TASK_VERTEX_ID, vertexId.toString());
		variables.put(ScopeFormat.SCOPE_TASK_NAME, taskName);
		variables.put(ScopeFormat.SCOPE_TASK_ATTEMPT_ID, executionId.toString());
		variables.put(ScopeFormat.SCOPE_TASK_ATTEMPT_NUM, String.valueOf(attemptNumber));
		variables.put(ScopeFormat.SCOPE_TASK_SUBTASK_INDEX, String.valueOf(subtaskIndex));
	}
1014340
public void addVar(Var var) {
        int id = var.getId();
        boolean alreadyAdded = (0 <= id && id < vars.size());
        if (alreadyAdded) {
            if (vars.get(id) != var) {
                throw new IllegalStateException("Var id already set, but factor not yet added.");
            }
        } else {  
            // Var was not yet in the factor graph.
            //
            // Check and set the id.
            if (id != -1 && id != vars.size()) {
                throw new IllegalStateException("Var id already set, but incorrect: " + id);
            }
            var.setId(vars.size());
            // Add the Var.
            vars.add(var);

            if (bg != null) { log.warn("Discarding BipartiteGraph. This may indicate inefficiency."); }
            bg = null;
        }
    }
1270862
public void setComponent(String component, Variable ... vars) {
		for (Variable var : vars) {
			if (var.getComponent() != null && !var.getComponent().equals(component)) {
				components.get(var.getComponent()).remove(var);
			}
		}
		if (!components.containsKey(component)) components.put(component, new ArrayList<Variable>());
		for (Variable var : vars) components.get(component).add(var);
	}

	/**
	 * Create a batch of new {@link Variable}s for this {@link ConstraintSolver}.
	 * @param num The number of variables to create.
	 * @return A batch of new {@link Variable}s.
	 */
	public final Variable[] createVariables(int num) {
		return this.createVariables(num, null);
	}

	/**
	 * Create a batch of new {@link Variable}s for this {@link ConstraintSolver}.
	 * @param num The number of variables to create.
	 * @param component The component tag to associate to these new variables.
	 * @return A batch of new {@link Variable}s.
	 */
	public final Variable[] createVariables(int num, String component) {
		Variable[] ret = createVariablesSub(num, component);
		if (ret == null) return null;
		//need to add all to network so if sth goes wrong I can delete all of them concurrently
		for (Variable v : ret) this.theNetwork.addVariable(v);
		if (!skipPropagation && autoprop && checkDomainsInstantiated() && !noPropOnVarCreation) this.propagate();
		logger.finest("Created variables " + Arrays.toString(ret));
		return ret;
	}
485202
def locate_set_var(var, override)

      hk = h.variables && h.variables.has_key?(var)

      if ( ! override) || var.match(/^\//)
        false
      elsif override == 'sub' && DefineExpression.is_definition?(tree) && ! hk
        false
      elsif hk
        [ self, var ]
      elsif par = parent
        par.locate_set_var(var, override)
      else
        false
      end
    end