Expand this template. Unresolved variables are removed. If all values remain unresolved, the
result is an empty string.

@param variables containing the values for expansion.
@return the expanded template.
549974
@Override
  public String expand(Map<String, ?> variables) {
    String name = this.name.expand(variables);
    return this.queryString(name, super.expand(variables));
  }
152554
public ValueExpression resolveVariable(String variable)
    {
        ValueExpression ve = null;
        try
        {
            if (_vars != null)
            {
                ve = (ValueExpression) _vars.get(variable);

                // Is this code in a block that wants to cache 
                // the resulting expression(s) and variable has been resolved?
                if (_trackResolveVariables && ve != null)
                {
                    _variableResolved = true;
                }
            }
            
            if (ve == null)
            {
                return _target.resolveVariable(variable);
            }
            
            return ve;
        }
        catch (StackOverflowError e)
        {
            throw new ELException("Could not Resolve Variable [Overflow]: " + variable, e);
        }
    }
573768
@Override
    public void setVariablesScope(Variables variables) {
	this.variables = variables;
	undefinedScope().setVariableScope(variables);

	if (variables instanceof ClosureScope) {
	    variables = ((ClosureScope) variables).getVariables();
	}
	if (variables instanceof StaticScope) {
	    activeComponent = ((StaticScope) variables).getComponent();
	}
	else if (variables instanceof ComponentScope) {
	    activeComponent = ((ComponentScope) variables).getComponent();
	}
	else {
	    activeComponent = null;
	}
    }
81300
private void variable( HashMap<String, Expression> variables, FormattableContainer currentRule ) {
        StringBuilder builder = cachesBuilder;
        builder.append( '@' );
        char ch;
        LOOP: for( ;; ) {
            ch = read();
            switch( ch ) {
                case ':':
                    if( !isVariableName(builder) ) {
                        builder.append( ch );
                        continue;
                    }
                    break LOOP;
                case ';':
                    String name = trim( builder );
                    if( name.startsWith( "@import " ) ) {
                        importFile( currentRule, name.substring( 8 ).trim() );
                        return;
                    }
                    if( name.endsWith( "()" ) ) {
                        currentRule.add( new VariableExpression( reader, name.substring( 0, name.length() - 2 ) ) ); // reference to detached ruleset
                    } else {
                        currentRule.add( new CssAtRule( reader, name + ';') ); // directives like @charset "UTF-8";
                    }
                    return;
//                    throw createException( "Unrecognized input: '" + name + "'" );
                default:
                    builder.append( ch );
            }
        }
        String name = trim( builder );
        Expression value = parseExpression( (char)0 );
        ch = read();
        if( ch == '}' ) {
            back( ch );
        } else {
            if( ch != ';' ) {
                throw createException( "Unrecognized input: '" + ch + "'" );
            }
        }
        variables.put( name, value );
    }
1006798
public EnvironmentResponse withVariables(java.util.Map<String, String> variables) {
        setVariables(variables);
        return this;
    }
192932
public String expand(Map<String, Object> vars) throws VariableExpansionException
    {
        this.values = vars;
        return expand();
    }
774282
public TemplateVariables concat(Collection<TemplateVariable> variables) {

		List<TemplateVariable> result = new ArrayList<>(this.variables.size() + variables.size());
		result.addAll(this.variables);

		List<TemplateVariable> filtered = variables.stream() //
				.filter(variable -> !containsEquivalentFor(variable)).collect(Collectors.toList());

		result.addAll(filtered);

		return new TemplateVariables(result);
	}
345277
public void setVariables(List<VariableInitializer> variables) {
        assertNotNull(variables);
        this.variables.clear();
        for (VariableInitializer vi : variables) {
            addVariable(vi);
        }
    }
849396
public static function fromTemplate($template, array $variables)
    {
        if (strpos($template, '{') !== false) {
            $url = uri_template($template, $variables);
        } else {
            $url = $template;
        }

        return self::fromString($url);
    }
1212708
@Override
    public Object resolveVariable(QName variableName) {
        final Map<String, ?> variables = this.localVariables.get();
        if (variables == null) {
            return null;
        }

        final String localPart = variableName.getLocalPart();
        return variables.get(localPart);
    }
303575
protected void generateJsOptionsForTemplateContent(final Map<String, Object> variables,
		final StringBuilder sb)
	{
		sb.append("{\n");
		int count = 1;
		Object localComponentId = null;
		if (withComponentId)
		{
			localComponentId = variables.get(COMPONENT_ID);
			variables.remove(COMPONENT_ID);
		}
		for (final Map.Entry<String, Object> entry : variables.entrySet())
		{
			final String key = entry.getKey();
			sb.append(key).append(": ${").append(key).append("}");
			if (count < variables.size())
			{
				sb.append(",\n");
			}
			else
			{
				sb.append("\n");
			}
			count++;
		}
		if (withComponentId)
		{
			variables.put(COMPONENT_ID, localComponentId);
		}
		sb.append("}");
	}
111596
public DynamicVariableSet addFixedVariable(String name, Variable variable) {
    int variableIndex = fixedVariableMaxInd + 1;
    return new DynamicVariableSet(fixedVariables.addMapping(variableIndex, name, variable),
        plateNames, plates, maximumReplications);
  }
1172592
def get_expanded(self, *args, **kwargs):
        
        kwargs.setdefault("expandvars", True)
        kwargs.setdefault("expanduser", True)
        return self.get_default(*args, **kwargs)
949039
public URI expand(Object... parameters) {

		if (TemplateVariables.NONE.equals(variables)) {
			return URI.create(baseUri);
		}

		org.springframework.web.util.UriTemplate baseTemplate = new org.springframework.web.util.UriTemplate(baseUri);
		UriComponentsBuilder builder = UriComponentsBuilder.fromUri(baseTemplate.expand(parameters));
		Iterator<Object> iterator = Arrays.asList(parameters).iterator();

		for (TemplateVariable variable : getOptionalVariables()) {

			Object value = iterator.hasNext() ? iterator.next() : null;
			appendToBuilder(builder, variable, value);
		}

		return builder.build().toUri();
	}
1260854
@Override
	protected void putVariables(Map<String, String> variables) {
		variables.put(ScopeFormat.SCOPE_HOST, hostname);
	}
1336252
def variables(template):
    ''''''
    vars = set()
    for varlist in TEMPLATE.findall(template):
        if varlist[0] in OPERATOR:
            varlist = varlist[1:]
        varspecs = varlist.split(',')
        for var in varspecs:
            # handle prefix values
            var = var.split(':')[0]
            # handle composite values
            if var.endswith('*'):
                var = var[:-1]
            vars.add(var)
    return vars
706427
public void setVariables(Map<String, String> variables)
    {
        if (this.variables != null)
        {
            this.variables.putAll(variables);
        }
        else
        {
            this.variables = variables;
        }
    }