Finds predefined variable value in variables object
Returns variable value if any resolved
@param name
@param values
@returns {*}
435475
function resolveVarValue (name, values) {
    if (is.undef(values) || is.args.empty(arguments)) {
        message('Error: Missing arguments');
        return undefined;
    }

    if (!is.string(name) || !is.object(values)) {
        message('Error: Check arguments type');
        return undefined;
    }

    const varName = name.slice(1);

    return values[varName] || null;
}
621943
function findVariables(string) {
  // Do not parse empty files. Otherwise gonzales.parse will fail
  if (!string) {
    return [];
  }

  var out = [],
      ast = gonzales.parse(string, {
        syntax: 'less'
      });

  ast.traverseByType('value', function(subAst) {
    subAst.traverseByType('variable', function(node) {
      out.push(node.content.toString());
    });
  });

  return out;
}
119014
public T find(V value) {
		checkInit();

		for (T obj : preDefined) {
			if (matches(obj, value)) {
				return obj;
			}
		}
		return null;
	}
1207415
def get_var(self, name):
        
        for var in self.vars:
            if var.name == name:
                return var
        else:
            raise ValueError
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;
  }
5017
def _GetValue(self, name):
    """"""
    for value in self.values:
      if value.name == name:
        return value
772709
def values(self, name):
        
        return list(self.lookup_variables.get(unnest_path(name), Null))
1153248
protected List<Value> getDefinedValues(TaskRuntimeContext runtimeContext) {
        List<Value> values = new ArrayList<Value>();
        String varAttr = runtimeContext.getTaskAttribute(TaskAttributeConstant.VARIABLES);
        if (!StringHelper.isEmpty(varAttr)) {
            List<String[]> parsed = StringHelper.parseTable(varAttr, ',', ';', 5);
            for (String[] one : parsed) {
                String name = one[0];
                Value value = new Value(name);
                if (one[1] != null && !one[1].isEmpty())
                    value.setLabel(one[1]);
                value.setDisplay(Value.getDisplay(one[2]));
                if (one[3] != null && !one[3].isEmpty())
                    value.setSequence(Integer.parseInt(one[3]));
                if (one[4] != null && !one[4].isEmpty())
                    value.setIndexKey(one[4]);
                if (value.isExpression()) {
                    value.setType(String.class.getName());
                }
                else {
                    Variable var = runtimeContext.getProcess().getVariable(name);
                    if (var != null)
                        value.setType(var.getType());
                }
                values.add(value);
            }
        }
        return values;
    }
97285
protected function resolveValue($name, $variables)
    {
        if (!empty($variables)) {
            foreach ($variables as $container => $vars) {
                foreach ($vars as $subname => $var) {
                    $value = $var['value'];

                    if(is_callable($value) && $var['name'] === $name) {
                        return $value($this->variables);
                    }

                    if (isset($var['name']) and $name == $value and isset($value)) {
                        return $value;
                    }
                    elseif (!isset($var['name']) and $subname == $name and isset($value)) {
                        return $value;
                    }
                }
            }
        }

        if (!isset($variables[$name])) {
            return false;
        }

        if (isset($variable['dataProvider'])) {
            $value = $this->resolveDataProviderValue($variable['dataProvider']);
            if (!$value) {
                return false;
            }
            return $value;
        }

        return array_get($variable, 'value', '');
    }
691631
def lookup(parser, var, context, resolve=True, apply_filters=True):
    
    if resolve:
        try:
            return Variable(var).resolve(context)
        except VariableDoesNotExist:
            if apply_filters and var.find('|') > -1:
                return parser.compile_filter(var).resolve(context)
            return Constant(var)
        except TypeError:
            # already resolved
            return var
    return var
735068
@Override
    public Map<String, String> getValues(final String variableContains)  {
        final Map<String, String> variableSelection = new HashMap<>();
        for (Entry<String, String> entry : variableMap.entrySet()) {
            if (entry.getKey().contains(variableContains)) {
                if (!entry.getValue().isEmpty()) {
                    variableSelection.put(entry.getKey(), entry.getValue());
                }
            }
        }
        return variableSelection;
    }
41766
public String resolveString(String value, boolean ignoreWarnings) throws ConfigEvaluatorException {
        value = variableEvaluator.resolveVariables(value, this, ignoreWarnings);
        return value;
    }
872665
def _get_variable_value(defined_variables, name):
    
    def fallback(*args, **kwargs):
        raise AssertionError("Variable {0} is not defined in class {1}".format(
                name, defined_variables.__class__.__name__))
    method = getattr(defined_variables, name, fallback)
    val = method()
    return method.field_type(val)
569160
public static String resolve(String value, Map<String, String> properties) {
		do {
			int i = value.indexOf("${");
			if (i < 0) return value;
			int j = value.indexOf('}', i + 2);
			if (j < 0) return value;
			String name = value.substring(i + 2, j);
			String val = properties.get(name);
			if (val == null) val = "";
			value = value.substring(0, i) + val + value.substring(j + 1);
		} while (true);		
	}
489415
public VarValueDefBuilder has( String name, Object value)
    {
    varValueDef_.setAnnotation( name, Objects.toString( value, null));
    return this;
    }
118092
private String get(String... values) {
            if (values != null) {
                for (String value : values) {
                    if (!StringUtils.isEmpty(value)) {
                        return value;
                    }
                }
            }
            return null;
        }
1272610
function markVariableAsUsed(context, name) {
  let scope = context.getScope();
  let variables;
  let i;
  let len;
  let found = false;

  // Special Node.js scope means we need to start one level deeper
  if (scope.type === 'global') {
    while (scope.childScopes.length) {
      scope = scope.childScopes[0];
    }
  }

  do {
    variables = scope.variables;
    for (i = 0, len = variables.length; i < len; i++) { // eslint-disable-line no-plusplus
      if (variables[i].name === name) {
        variables[i].eslintUsed = true;
        found = true;
      }
    }
    scope = scope.upper;
  } while (scope);

  return found;
}