Return the final key applying variables as needed

@param variableValues map of variable names to values
@return the key
345081
public String getKey(Map<String, String> variableValues)
    {
        StringBuilder key = new StringBuilder();
        for ( ConfigurationKeyPart p : parts )
        {
            if ( p.isVariable() )
            {
                String value = variableValues.get(p.getValue());
                if ( value == null )
                {
                    log.warn("No value found for variable: " + p.getValue());
                    value = "";
                }
                key.append(value);
            }
            else
            {
                key.append(p.getValue());
            }
        }

        return key.toString();
    }
332724
public function getVariable($variableName, $defaultValue = null)
    {
        return isset($this->variables[$variableName]) ?
            $this->variables[$variableName] : $defaultValue;
    }
438816
public List<Set<String>> makeNWiseTuples(String[] variables, int nWise) {
        List<Set<String>> completeTuples = new ArrayList<>();
        makeNWiseTuplesHelper(completeTuples, variables, 0, new HashSet<String>(), nWise);

        return completeTuples;
    }
275205
@Override
    public Map<String, String> getValues(String variableContains) {
        final Map<String, String> variableSelection = new HashMap<>();
        String key;
        for (Map.Entry<Descriptors.FieldDescriptor, Object> fieldEntry : message.getAllFields().entrySet()) {
            key = StringProcessor.transformToUpperCase(fieldEntry.getKey().getName());
            if (key.contains(variableContains) || (StringProcessor.transformToUpperCase(message.getClass().getSimpleName()) + "/" + key).contains(variableContains)) {
                if (!fieldEntry.getValue().toString().isEmpty()) {
                    variableSelection.put(key, fieldEntry.getValue().toString());
                }
            }
        }
        return variableSelection;
    }
919924
protected Map getAllVariables(){
        try{
            Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator();
            Map vars = new HashMap();
            while (names.hasNext()) {
                Object name =names.next();
                vars.put(name, get(name.toString()));
            }
            return vars;
        }catch(Exception e){
            throw new ViewException(e);
        }
    }
1111220
function(varVal, varName, variablesMap){
    if(typeof variablesMap !== 'object' || !variablesMap){
      variablesMap = VAR_MAP;
    }
    if(variablesMap.hasOwnProperty(varName)){
      return variablesMap[varName];
    }
    if(varName.indexOf('.') !== -1){
      var spls = varName.split('.'), ln = spls.length, valFound = true;
      if(ln){
        var base = getVarVal(spls[0], spls[0], variablesMap), curVal;
        for(var j = 1; j < ln; j++){
          if(spls[j].length){
            if(typeof base === 'object'){
              curVal = (spls[j] === '$' && Array.isArray(base))
                ? getVarVal(spls[j], spls[j], variablesMap) : spls[j];
              try {
                base = base[curVal];
              } catch(er){
                V_DEBUG(er);
                valFound = false;
              }
            } else {
              valFound = false;
            }
          }
        }
        if(valFound){
          return base;
        }
      }
    }
    return variablesMap.hasOwnProperty(varName) ? variablesMap[varName] : varVal;
  }
691455
public Collection<Variable> getVariables() {
        if (parent == null) {
            return getLocalVariables();
        }
        List<Variable> result = new ArrayList<>();
        result.addAll(parent.getVariables());
        result.addAll(getLocalVariables());
        return result;
    }
1324878
public Map<String, String> getVariables() {
        HashMap<String, String> map = new HashMap<String, String>(mtp.varTabCnt);
        for (int varNo = 0; varNo < mtp.varTabCnt; varNo++)
            map.put(mtp.varTab[varNo], varValuesTab[varNo]);
        return map;
    }
624180
public void putIndexedVariableProperties(String key, List<Map<String, String>> subKeyValues) {
		checkNotNull(key);
		checkNotNull(subKeyValues);
		for (int idx = 0; idx < subKeyValues.size(); idx++) {
			final Map<String, String> values = subKeyValues.get(idx);
			for (Map.Entry<String, String> value : values.entrySet()) {
				put(key + '.' + idx + '.' + value.getKey(), value.getValue());
			}
		}
	}
1308108
public static Object getVariableEL(PageContext pc, String var, Object defaultValue) {
	StringList list = parse(pc, new ParserString(var), false);
	if (list == null) return defaultValue;

	int scope = scopeString2Int(pc.ignoreScopes(), list.next());
	Object coll = null;
	if (scope == Scope.SCOPE_UNDEFINED) {
	    coll = pc.undefinedScope().get(KeyImpl.init(list.current()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	else {
	    try {
		coll = VariableInterpreter.scope(pc, scope, list.hasNext());
		// coll=pc.scope(scope);
	    }
	    catch (PageException e) {
		return defaultValue;
	    }
	}

	while (list.hasNext()) {
	    coll = pc.getVariableUtil().get(pc, coll, KeyImpl.init(list.next()), NullSupportHelper.NULL());
	    if (coll == NullSupportHelper.NULL()) return defaultValue;
	}
	return coll;
    }
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);
	}
521649
def _get_virtual_variable(variables, key, level_vars=None, dim_sizes=None):
    
    if level_vars is None:
        level_vars = {}
    if dim_sizes is None:
        dim_sizes = {}

    if key in dim_sizes:
        data = pd.Index(range(dim_sizes[key]), name=key)
        variable = IndexVariable((key,), data)
        return key, key, variable

    if not isinstance(key, str):
        raise KeyError(key)

    split_key = key.split('.', 1)
    if len(split_key) == 2:
        ref_name, var_name = split_key
    elif len(split_key) == 1:
        ref_name, var_name = key, None
    else:
        raise KeyError(key)

    if ref_name in level_vars:
        dim_var = variables[level_vars[ref_name]]
        ref_var = dim_var.to_index_variable().get_level_variable(ref_name)
    else:
        ref_var = variables[ref_name]

    if var_name is None:
        virtual_var = ref_var
        var_name = key
    else:
        if _contains_datetime_like_objects(ref_var):
            ref_var = xr.DataArray(ref_var)
            data = getattr(ref_var.dt, var_name).data
        else:
            data = getattr(ref_var, var_name).data
        virtual_var = Variable(ref_var.dims, data)

    return ref_name, var_name, virtual_var
1099257
@Override
    public Map<String, String> getUserDefinedVariableDefaults() {
        HashMap<String, String> userDefinedVariables = new HashMap<String, String>();
        for (Map.Entry<String, ConfigVariable> entry : configVariables.entrySet()) {
            ConfigVariable var = entry.getValue();
            if (var.getValue() == null && var.getDefaultValue() != null) {
                userDefinedVariables.put(var.getName(), var.getDefaultValue());
            }
        }
        return userDefinedVariables;
    }
1322078
def _get_vars_to_collections(variables):
  """"""
  var_to_collections = collections.defaultdict(lambda: [])
  if isinstance(variables, dict):
    variables = list(v for _, v in variable_map_items(variables))
  for graph in set(v.graph for v in variables):
    for collection_name in list(graph.collections):
      entries = set(entry for entry in graph.get_collection(collection_name)
                    if isinstance(entry, tf.Variable))
      # For legacy reasons, tf.GraphKeys.GLOBAL_VARIABLES == "variables".
      # Correcting for this here, to avoid confusion.
      if collection_name == tf.GraphKeys.GLOBAL_VARIABLES:
        collection_name = "global_variables"
      for var in entries.intersection(variables):
        var_to_collections[var].append(collection_name)
  return var_to_collections
1293511
public SDVariable[] updateVariableNamesAndReferences(SDVariable[] variablesToUpdate, String[] newVariableNames) {

        int numVariables = variablesToUpdate.length;
        SDVariable[] updatedVariables = new SDVariable[numVariables];

        for (int i = 0; i < numVariables; i++) {
            SDVariable varToUpdate = variablesToUpdate[i];
            String name = newVariableNames == null ? null : newVariableNames[i];
            updatedVariables[i] = updateVariableNameAndReference(varToUpdate, name);
        }

        return updatedVariables;
    }
806259
@Override
  public Set<String> getVariables() {
    Set<String> variables = lhs.getVariables();
    variables.addAll(rhs.getVariables());

    return variables;
  }
1037907
function replaceValuesWithVariableNames (variables, prefix) {
  const map = {}

  Object.keys(variables || {}).forEach((variableName) => {
    map[variableName] = `var(${formatVariableName(variableName, prefix)})`
  })

  return map
}