Add the specified variable to this SameDiff instance
@param variable Variable to add
432043
public SDVariable addVariable(SDVariable variable) {
        Preconditions.checkState(variable.getSameDiff() == this, "Samediff instance must be the same.");

        if (variables.containsKey(variable.getVarName()) && !variables.get(variable.getVarName()).getVariable().equals(variable)) {
            throw new IllegalArgumentException("Variable already found with variable opName " + variable.getVarName());
        }

        Preconditions.checkState(variable.getSameDiff() == this, "Same diff instance for variable must be the same!");
        variables.put(variable.getVarName(), Variable.builder().name(variable.getVarName()).variable(variable).build());
        return variable;
    }
1322066
private void addToUsedVariables(final java.util.List<VariableAndValue> usedVariables, final MethodAndParameter top, final Variable variable) {
        VariableAndValue variableAndValue = new VariableAndValue(variable, top.getParameter());
        if (!usedVariables.contains(variableAndValue)) {
            usedVariables.add(variableAndValue);
        } else {
            int i = 0;
            do {
                i++;
                variableAndValue = new VariableAndValue(
                        new Variable(
                                elementUtils.getName(variable.getName().toString() + i),
                                variable.getType()
                        ),
                        top.getParameter()
                );
            } while (usedVariables.contains(variableAndValue));
            usedVariables.add(variableAndValue);
        }
    }
216145
def _AddVariable(self, variable):
        
        if isinstance(variable, Signal):
            if not variable in self.signals:
                self.signals.append(variable)
        elif isinstance(variable, Variable):
            if not variable in self.variables:
                self.variables.append(variable)
        else:
            raise TypeError
        self._utd_graph = False
990087
public function addVariable(PhpVariable $variable)
    {
        if ($this->variableExists($variable->getIdentifier())) {
            throw new Exception('A variable of the name (' . $variable->getIdentifier() . ') does already exist.');
        }

        $this->variables[$variable->getIdentifier()] = $variable;
    }
772313
def add_variable(self, name):
        """"""
        if name in self._variables:
            raise ValueError(
                "A variable named " + name + " already exists."
            )
        self._variables[name] = len(self._variables)
        self.bounds[name] = (0, None)

        new_col = np.zeros(shape=[len(self._constraints), 1])
        self._add_col_to_A(new_col)
        self._reset_solution()
398028
private void addScopeVariables() {
    int num = 0;
    for (Var v : orderedVars) {
      scopeVariables.put(v.getName(), num);
      num++;
    }
  }
940789
public void setVariable(ElemVariable v)
  {

    if (null == m_topLevelVariables)
      m_topLevelVariables = new Vector();

    m_topLevelVariables.addElement(v);
  }
317939
public void addVariable(String attribute, String varName, String value) {
	Bindings binds = rslTree.getBindings(attribute);
	if (binds == null) {
	    binds = new Bindings(attribute);
	    rslTree.put(binds);
	}
	binds.add(new Binding(varName, value));
    }
515291
@Override
	protected void putVariables(Map<String, String> variables) {
		variables.put(ScopeFormat.SCOPE_JOB_ID, jobId.toString());
		variables.put(ScopeFormat.SCOPE_JOB_NAME, jobName);
	}
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));
	}
478396
function addVariable() {
            variableService.addOrUpdate(vm.variable, function () {
                vm.variables[vm.variable.key] = vm.variable.value;
                vm.variable = {
                    key: undefined,
                    value: undefined
                };
            });
        }
610505
public static void addToEnvironment(Map<String, String> environment,
			String variable, String value) {
		String val = environment.get(variable);
		if (val == null) {
			val = value;
		} else {
			val = val + File.pathSeparator + value;
		}
		environment.put(StringInterner.weakIntern(variable),
				StringInterner.weakIntern(val));
	}
375644
private void addVariablesToBuffer(final java.util.List<VariableAndValue> usedVariables, final ListBuffer listBuffer) {
        for (VariableAndValue variableAndValue : usedVariables) {
            listBuffer.add(variableAndValue.getValue());
        }
    }
588289
@Override
  public void recordVariableCreate(VariableInstanceEntity variable) {
    // Historic variables
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
     getHistoricVariableInstanceEntityManager().copyAndInsert(variable);
    }
  }
738245
public void addVariable(VariableInitializer v) {
        assertNotNull(v);
        variables.add(v);
        v.setParent(this);
    }
461237
public void setTrainingLabel(int variable, int value) {
    getVariableMetaDataByReference(variable).put(LogLikelihoodDifferentiableFunction.VARIABLE_TRAINING_VALUE, Integer.toString(value));
  }
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