Replaces any __variable__ in the supplied name with the corresponding value in the model

@param name
@return
172406
private String resolveVariables(String name) {
		// Replace __variable__ with ${variable} and then evaluate the name as a groovy string
		String outName = "";
		int startPos = 0;
		int pos = name.indexOf("__", startPos);
		while (pos != -1) {
			outName += name.substring(startPos, pos);
			int endPos = name.indexOf("__", pos + 2);
			String variableName = name.substring(pos + 2, endPos);
			Object variableValue = model.resolveParameter(variableName, null);
			if (variableValue == null) {
				logWarn("Found no filepath variable __" + variableName + "__! Will use default value: " + variableName);
				variableValue = variableName;
			}
			logDebug("Found filepath variable: " + variableName + " = " + variableValue);
			outName += variableValue;
			startPos = endPos + 2;

			// Look for the next variable
			pos = name.indexOf("__", startPos);
		}
		outName += name.substring(startPos);
		logDebug("Resolved filepath [" + name + "] to [" + outName + "]");
		return outName;
	}
98084
public SDVariable transpose(String name, SDVariable x) {
        SDVariable result = f().transpose(x);
        return updateVariableNameAndReference(result, name);
    }
114310
def varbind(name, value=Null)
      if name.respond_to? :to_str
        vb = VarBind.new(oid(name), value)
      else
        vb = name.to_varbind
        vb.value = value
      end
      vb
    end
141920
public ISarlFieldBuilder addVarSarlField(String name) {
		ISarlFieldBuilder builder = this.iSarlFieldBuilderProvider.get();
		builder.eInit(getSarlBehavior(), name, "var", getTypeResolutionContext());
		return builder;
	}
1347456
Variable getVariable(String name) {
    VarKey varKey = VarKey.create(Kind.USER_DEFINED, name);
    return getVariable(varKey);
  }
578481
public V getVar(String name) {
    ImplicitVar implicit = name != null ? ImplicitVar.of(name) : null;
    if (implicit != null) {
      return getImplicitVar(implicit, true);
    }
    S scope = thisScope();
    while (scope != null) {
      V var = scope.getOwnSlot(name);
      if (var != null) {
        return var;
      }
      // Recurse up the parent Scope
      scope = scope.getParent();
    }
    return null;
  }
262932
public SDVariable l2Loss(String name, @NonNull SDVariable var) {
        validateNumerical("l2 loss", var);
        SDVariable result = f().lossL2(var);
        result = updateVariableNameAndReference(result, name);
        result.markAsLoss();
        return result;
    }
739102
public static String substitute(String input, List<VariableInstance> variables)
    throws MdwException {
        StringBuffer substituted = new StringBuffer(input.length());
        try {
            Matcher matcher = tokenPattern.matcher(input);
            int index = 0;
            while (matcher.find()) {
                String match = matcher.group();
                substituted.append(input.substring(index, matcher.start()));
                Object value = getVariableValue(match.substring(2, match.length() - 1), variables);
                if (value != null)
                    substituted.append(value);
                index = matcher.end();
            }
            substituted.append(input.substring(index));
            return substituted.toString();
        }
        catch (Exception ex) {
            throw new MdwException("Error substituting expression value(s) in input: '" + input + "'", ex);
        }
    }
898632
public SDVariable erf(String name, SDVariable x) {
        validateNumerical("erf (error function)", x);
        SDVariable ret = f().erf(x);
        return updateVariableNameAndReference(ret, name);
    }
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;
    }
50714
public static boolean isVariableReplacementPattern(final String value) {
    final Matcher matcher = VARIABLE_REPLACEMENT_PATTERN.matcher(value);
    return matcher.matches();
  }
135728
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException {
        if (this.request.hasAttribute(localName)) {
            return String.valueOf(this.request.getAttribute(localName));
        }
        
        return null;
    }
1327432
public static Protos.Environment.Variable variable(String name, String value) {
		checkNotNull(name);
		return Protos.Environment.Variable.newBuilder()
			.setName(name)
			.setValue(value)
			.build();
	}
1254985
public SDVariable zeroFraction(String name, SDVariable input) {
        validateNumerical("zeroFraction", input);
        SDVariable res = f().zeroFraction(input);
        return updateVariableNameAndReference(res, name);
    }
498783
def substitute_vars(template, replacements):
    
    result = template
    for (key, value) in replacements:
        result = result.replace('${' + key + '}' , value)
    if '${' in result:
        logging.warning("A variable was not replaced in '%s'.", result)
    return result
327248
public VarValueDef getValue( Object name)
    {
    int i = findValue( name);
    return i >= 0? values_.get(i) : null;
    }
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;
        }
    }