Unassign the variable name.
Name should evaluate to a variable.
552685
public void unset( String name )
        throws EvalError
    {
        /*
            We jump through some hoops here to handle arbitrary cases like
            unset("bsh.foo");
        */
        CallStack callstack = new CallStack();
        try {
            LHS lhs = globalNameSpace.getNameResolver( name ).toLHS(
                callstack, this );

            if ( lhs.type != LHS.VARIABLE )
                throw new EvalError("Can't unset, not a variable: "+name,
                    SimpleNode.JAVACODE, new CallStack());

            lhs.nameSpace.unsetVariable( name );
        } catch ( UtilEvalError e ) {
            throw new EvalError( e.getMessage(),
                SimpleNode.JAVACODE, new CallStack(), e);
        }
    }
601050
def unoptimize_scope(self, frame):
        """"""
        # XXX: this is not that nice but it has no real overhead.  It
        # mainly works because python finds the locals before dead code
        # is removed.  If that breaks we have to add a dummy function
        # that just accepts the arguments and does nothing.
        if frame.identifiers.declared:
            self.writeline('%sdummy(%s)' % (
                unoptimize_before_dead_code and 'if 0: ' or '',
                ', '.join('l_' + name for name in frame.identifiers.declared)
            ))
520350
def _transform(self, var):
        '''  '''
        self.collection.variables.pop(var.name)
        return var.values
681575
@Nonnull
  public PreprocessorContext removeLocalVariable(@Nonnull final String name) {
    assertNotNull("Variable name is null", name);
    final String normalized = assertNotNull(PreprocessorUtils.normalizeVariableName(name));

    if (normalized.isEmpty()) {
      throw makeException("Empty variable name", null);
    }

    if (mapVariableNameToSpecialVarProcessor.containsKey(normalized) || globalVarTable.containsKey(normalized)) {
      throw makeException("Attempting to remove either a global variable or a special variable as a local one [" + normalized + ']', null);
    }

    if (isVerbose()) {
      logForVerbose("Removing local variable '" + normalized + "\'");
    }
    localVarTable.remove(normalized);
    return this;
  }
1007521
public void alias( double value , String name ) {
        if( isReserved(name))
            throw new RuntimeException("Reserved word or contains a reserved character. '"+name+"'");

        VariableDouble old = (VariableDouble)variables.get(name);
        if( old == null ) {
            variables.put(name, new VariableDouble(value));
        }else {
            old.value = value;
        }
    }
594822
def _unmangle_attribute_name(name):
    """"""

    # Python keywords cannot be used as variable names, an underscore should
    # be appended at the end of each of them when defining attribute names.
    name = _PYTHON_KEYWORD_MAP.get(name, name)

    # Attribute names are mangled with double underscore, as colon cannot
    # be used as a variable character symbol in Python. Single underscore is
    # used for substituting dash.
    name = name.replace('__', ':').replace('_', '-')

    return name
367809
@Nonnull
  public EChange removeVariable (@Nullable final String sName)
  {
    if (sName == null)
      return EChange.UNCHANGED;
    return m_aMap.removeObject (sName);
  }
1151332
def uncamel(name):
    """"""
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
1321597
function fixVarNames(varObj = {}) {
    const reLeadingHyphens = /^-{2}/;

    return Object.keys(varObj).reduce((obj, value) => {
        const key = reLeadingHyphens.test(value) ? value : `--${value.replace(/^-+/, '')}`;

        obj[key] = varObj[value];

        return obj;
    }, {});
}
1299341
def visit_Assignment(self, node):
        """"""
        var_name = node.left.identifier.name
        var_symbol = self.table[var_name]

        if var_symbol is not None and not var_symbol.is_mutable:
            raise SementicError(f"Re-assignment of immutable variable `{var_name}`.")

        self.visit(node.left)
        self.visit(node.right)
637501
public OutputVariable removeOutputVariable(String name) {
        for (Iterator<OutputVariable> it = this.outputVariables.iterator(); it.hasNext();) {
            OutputVariable outputVariable = it.next();
            if (outputVariable.getName().equals(name)) {
                it.remove();
                return outputVariable;
            }
        }
        throw new RuntimeException(String.format(
                "[engine error] no output variable by name <%s>", name));
    }
551165
def ClearVar(self):
    """"""
    self.value = None
    # Call OnClearVar on options.
    _ = [option.OnClearVar() for option in self.options]
886185
public InputVariable removeInputVariable(String name) {
        for (Iterator<InputVariable> it = this.inputVariables.iterator(); it.hasNext();) {
            InputVariable inputVariable = it.next();
            if (inputVariable.getName().equals(name)) {
                it.remove();
                return inputVariable;
            }
        }
        throw new RuntimeException(String.format(
                "[engine error] no input variable by name <%s>", name));
    }
438670
public void updateVariableName(String varName, String withName) {
        SDVariable oldVarNameRef = getVariable(varName);
        Variable v = variables.remove(varName);
        String oldVarName = varName;
        oldVarNameRef.setVarName(withName);
        v.setName(withName);
        variables.put(withName, v);

        for(SameDiffOp op : ops.values()){
            List<String> outputsOfOp = op.getOutputsOfOp();
            if(outputsOfOp != null && !outputsOfOp.isEmpty()) {
                for (int i = 0; i < outputsOfOp.size(); i++) {
                    if (outputsOfOp.get(i).equals(oldVarName)) {
                        outputsOfOp.set(i, withName);
                    }
                }
            }

            List<String> inputsToOp = op.getInputsToOp();
            if(inputsToOp != null && !inputsToOp.isEmpty()) {
                for (int i = 0; i < inputsToOp.size(); i++) {
                    if (inputsToOp.get(i).equals(oldVarName)) {
                        inputsToOp.set(i, withName);
                    }
                }
            }
        }

//        if (variableNameToArr.containsKey(oldVarName)) {
//            val arr = variableNameToArr.remove(oldVarName);
//            variableNameToArr.put(withName, arr);
//        }


        if (variableNameToShape.containsKey(oldVarName)) {
            val shape = variableNameToShape.remove(oldVarName);
            variableNameToShape.put(withName, shape);
        }

        if (forwardVarForGrad.containsKey(oldVarName)) {
            val forwardGrad = forwardVarForGrad.remove(oldVarName);
            forwardVarForGrad.put(withName, forwardGrad);
        }


        if (v.getInputsForOp() != null) {
            List<String> funcNames = v.getInputsForOp();
            for (String s : funcNames) {
                DifferentialFunction func = ops.get(s).getOp();
                if (func instanceof BaseOp) {
                    BaseOp baseOp = (BaseOp) func;
                    if (baseOp.getXVertexId() != null && baseOp.getXVertexId().equals(oldVarName)) {
                        baseOp.setXVertexId(withName);
                    }

                    if (baseOp.getYVertexId() != null && baseOp.getYVertexId().equals(oldVarName)) {
                        baseOp.setYVertexId(withName);
                    }

                    if (baseOp.getZVertexId() != null && baseOp.getZVertexId().equals(oldVarName)) {
                        baseOp.setZVertexId(withName);
                    }

                }
            }
        }


        if (v.getOutputOfOp() != null) {
            DifferentialFunction func = ops.get(v.getOutputOfOp()).getOp();
            if (func instanceof BaseOp) {
                BaseOp baseOp = (BaseOp) func;
                if (baseOp.getXVertexId() != null && baseOp.getXVertexId().equals(oldVarName)) {
                    baseOp.setXVertexId(withName);
                }

                if (baseOp.getYVertexId() != null && baseOp.getYVertexId().equals(oldVarName)) {
                    baseOp.setYVertexId(withName);
                }

                if (baseOp.getZVertexId() != null && baseOp.getZVertexId().equals(oldVarName)) {
                    baseOp.setZVertexId(withName);
                }
            }
        }
    }
890850
def destandardize_variables(self, tv, blin, bvar, errBeta, nonmissing):
        """"""
        return self.test_variables.destandardize(tv, blin, bvar, errBeta, nonmissing)
24334
def _get_variable_name_or_register(var, variables, names, params, prefix):
    '''
    
    '''
    if var not in variables.values():
        vname = prefix
        if var.data in params:
            vname = params[var.data]
        elif var in names:
            vname = names[var]
        vname = _get_unique_variable_name(vname, variables)
        variables[vname] = var
    else:
        vname = list(variables.keys())[list(variables.values()).index(var)]

    return vname
1225116
def getvariable(name):
    """"""
    import inspect
    fr = inspect.currentframe()
    try:
        while fr:
            fr = fr.f_back
            vars = fr.f_locals
            if name in vars:
                return vars[name]
    except:
        pass
    return None