Called to set an application variable to a value

@param   name     name of variable
@param   val      new value of variable - null means remove.
@param appVars
@return  boolean  True if ok - false for too many vars
971710
public boolean setAppVar(final String name, final String val,
                           final HashMap<String, String> appVars) {
    if (val == null) {
      appVars.remove(name);
      return true;
    }

    if (appVars.size() > maxAppVars) {
      return false;
    }

    appVars.put(name, val);
    return true;
  }
1131778
public SDVariable var(@NonNull String name, @NonNull VariableType variableType, WeightInitScheme weightInitScheme,
                             org.nd4j.linalg.api.buffer.DataType dataType, long... shape) {
        if (variables.containsKey(name) && variables.get(name).getVariable().getArr() != null)
            throw new IllegalArgumentException("Another variable with the name " + name + " already exists.");

        if (name == null || name.length() < 1)
            name = getNewVarName();


        SDVariable ret = new SDVariable(name, variableType, this, shape, dataType, weightInitScheme);
        addVariable(ret);

        if(variableType == VariableType.PLACEHOLDER){
            setOriginalPlaceHolderShape(name, shape);
            putShapeForVarName(name, shape);
        }
        return ret;
    }
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;
  }
458978
public T setAppName(String appName) {
    checkNotNull(appName, "appName");
    builder.appName = appName;
    return self();
  }
1206838
function setVariable( $var, $val, $namespace = '', $scopeSafe = false )
    {
        if ( $scopeSafe && isset( $this->Variables[$namespace][$var] ) )
        {
            $safeNamespace = $namespace;
            do
            {
                $safeNamespace .= ':safe';
            }
            while( isset( $this->Variables[$safeNamespace][$var] ) );

            $this->Variables[$safeNamespace][$var] = $this->Variables[$namespace][$var];
        }

        $this->Variables[$namespace][$var] = $val;
    }
272438
def var_set(session, **kwargs):
        
        if not kwargs:
            for name, value in session.variables.items():
                session.write_line("{0}={1}".format(name, value))
        else:
            for name, value in kwargs.items():
                name = name.strip()
                session.set(name, value)
                session.write_line("{0}={1}", name, value)
321104
public VarSetBuilder hasIf( String name, Object value)
    {
    return
      value != null
      ? has( name, value)
      : this;
    }
996935
@SuppressWarnings("unchecked")
    public void setVars(final Map<String, ? extends Object> vars) {
        this.vars = (Map<String, Object>)vars;
    }
721150
public static Object setVariable(PageContext pc, String var, Object value) throws PageException {
	StringList list = parse(pc, new ParserString(var), false);
	if (list == null) throw new InterpreterException("invalid variable name declaration [" + var + "]");

	if (list.size() == 1) {
	    return pc.undefinedScope().set(list.next(), value);
	}

	// min 2 elements
	int scope = scopeString2Int(pc.ignoreScopes(), list.next());
	Object coll;
	if (scope == Scope.SCOPE_UNDEFINED) {
	    coll = pc.touch(pc.undefinedScope(), KeyImpl.init(list.current()));
	}
	else {
	    coll = VariableInterpreter.scope(pc, scope, true);
	    // coll=pc.scope(scope);
	}

	while (list.hasNextNext()) {
	    coll = pc.touch(coll, KeyImpl.init(list.next()));
	}
	return pc.set(coll, KeyImpl.init(list.next()), value);
    }
999903
public final void setApplicationName(String... applicationNames) {
        synchronized (lock) {
            if (applicationNames == null) {
                serviceProperties.remove(APPLICATION_NAME);
            } else {
                serviceProperties.put(APPLICATION_NAME, applicationNames);
            }

            if (serviceRegistration != null) {
                serviceRegistration.setProperties(serviceProperties);
            }
        }
    }
598802
private boolean vForVariable(String loopVariablesDefinition, TemplateParserContext context) {
    Matcher matcher = VFOR_VARIABLE.matcher(loopVariablesDefinition);
    if (matcher.matches()) {
      initLoopVariable(matcher.group(1), matcher.group(2), context);
      indexVariableInfo = null;
      return true;
    }

    return false;
  }
541676
function set(appName, limits, callback) {
    if (!isObject(limits)) {
      return callback(new Error('To set a variable pass an object'));
    }

    var keyValues = {};

    if (limits.hasOwnProperty('memory')) {
      keyValues.memory = limits.memory;
    }

    if (limits.hasOwnProperty('cpu')) {
      keyValues.cpu = limits.cpu;
    }

    if (Object.keys(keyValues).length === 0) {
      return callback(new Error('Only cpu and memory limits are valid'));
    }

    commons.post(format('/%s/apps/%s/config/', deis.version, appName), keyValues,
        function onSetResponse(err, result) {
          callback(err, result ? extractLimits(result) : null);
        });
  }
753218
public void setBroadcastVariable(String name, List<?> value) {
		this.uninitializedBroadcastVars.put(name, value);
		this.initializedBroadcastVars.remove(name);
	}
424716
public VarDefBuilder has( String name, Object value)
    {
    varDef_.setAnnotation( name, Objects.toString( value, null));
    return this;
    }
595787
public static Variable getVariable(NameSpace ns, String name) {
        if (null == ns)
            return null;
        try {
            return ns.getVariableImpl(name, false);
        } catch (Exception e) {
            return null;
        }
    }
1295861
def set_variable(var, val, override=false)

      fexp, v = locate_set_var(var, override) || locate_var(var)

      fexp.un_set_variable(:set, v, val, (fexp.h.fei != h.fei)) if fexp
    end
367809
@Nonnull
  public EChange removeVariable (@Nullable final String sName)
  {
    if (sName == null)
      return EChange.UNCHANGED;
    return m_aMap.removeObject (sName);
  }