Checks if all given variables are there and if so, that they evaluate to true inside an if.
352254
public boolean variablesAvailable(Map<String, Object> model, String... vars) {
		final TemplateContext context = new TemplateContext(null, null, null, new ScopedMap(model), modelAdaptor, this,
				new SilentErrorHandler(), null);
		for (String var : vars) {
			final IfToken token = new IfToken(var, false);
			if (!(Boolean) token.evaluate(context)) {
				return false;
			}
		}
		return true;
	}
124823
def is_missing_variable(
    value_node: ValueNode, variables: Dict[str, Any] = None
) -> bool:
    """"""
    return isinstance(value_node, VariableNode) and (
        not variables or is_invalid(variables.get(value_node.name.value, INVALID))
    )
1034746
def variables(self):
    """"""
    result = []
    for _, value in sorted(self.variable_map.items()):
      if isinstance(value, list):
        result.extend(value)
      else:
        result.append(value)
    return result
1314129
def check_important_variables(self):
        
        if len(self.important_variables - set(self.args.keys())):
            raise TypeError("Some important variables are not set")
429788
protected void setVariable(String variableName, Object value, ExecutionEntity sourceExecution, boolean fetchAllVariables) {

    if (fetchAllVariables == true) {

      // If it's in the cache, it's more recent
      if (usedVariablesCache.containsKey(variableName)) {
        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);
      }

      // If the variable exists on this scope, replace it
      if (hasVariableLocal(variableName)) {
        setVariableLocal(variableName, value, sourceExecution, true);
        return;
      }

      // Otherwise, go up the hierarchy (we're trying to put it as high as possible)
      VariableScopeImpl parentVariableScope = getParentVariableScope();
      if (parentVariableScope != null) {
        if (sourceExecution == null) {
          parentVariableScope.setVariable(variableName, value);
        } else {
          parentVariableScope.setVariable(variableName, value, sourceExecution, true);
        }
        return;
      }

      // We're as high as possible and the variable doesn't exist yet, so
      // we're creating it
      if (sourceExecution != null) {
        createVariableLocal(variableName, value, sourceExecution);
      } else {
        createVariableLocal(variableName, value);
      }

    } else {

      // Check local cache first
      if (usedVariablesCache.containsKey(variableName)) {

        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);

      } else if (variableInstances != null && variableInstances.containsKey(variableName)) {

        updateVariableInstance(variableInstances.get(variableName), value, sourceExecution);

      } else {

        // Not in local cache, check if defined on this scope
        // Create it if it doesn't exist yet
        VariableInstanceEntity variable = getSpecificVariable(variableName);
        if (variable != null) {
          updateVariableInstance(variable, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);
        } else {

          VariableScopeImpl parent = getParentVariableScope();
          if (parent != null) {
            if (sourceExecution == null) {
              parent.setVariable(variableName, value, fetchAllVariables);
            } else {
              parent.setVariable(variableName, value, sourceExecution, fetchAllVariables);
            }

            return;
          }

          variable = createVariableInstance(variableName, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);

        }

      }

    }

  }
286746
public final boolean containsAllNames(VariableNumMap other) {
    int[] otherNums = other.nums;
    String[] otherNames = other.names;

    for (int i = 0; i < otherNums.length; i++) {
      int index = getVariableIndex(otherNums[i]);
      if (index < 0 || !otherNames[i].equals(names[index])) {
        return false;
      }
    }
    return true;
  }
707966
function checkVariable(variable) {
			getModifyingReferences(variable.references).forEach(function(reference) {
				context.report(
					reference.identifier,
					ProblemMessages.noConstantAssign,
					{
						name: reference.identifier.name
					});
			});
		}
445692
def compile_variables

      vars = h.parent_id ? parent.compile_variables : {}
      vars.merge!(h.variables) if h.variables

      vars
    end
352100
public boolean isLocalVariable(@Nullable final String variableName) {
    boolean result = false;
    if (variableName != null) {
      final String normalized = PreprocessorUtils.normalizeVariableName(variableName);
      result = this.localVarTable.containsKey(normalized);
    }
    return result;
  }
569218
@Override
    public boolean isConstructed(Variable variable) {
        return getVariables().contains(variable) && getRootNode().isConstructed(variable, getChildren());
    }
768616
def evaluate_condition(condition, vars):
    ''''''
    if condition is None:
        return True
    v = evaluate_expression(condition, vars)
    if v is None:
        return False
    return v
845263
function hasLocalVariable( $varName, $rootNamespace )
    {
        return ( array_key_exists( $rootNamespace, $this->CurrentLocalVariablesNames ) &&
                 array_key_exists( $varName, $this->CurrentLocalVariablesNames[$rootNamespace] ) );
    }
435477
public static boolean hasVariable( final String string,
                                       final String variableName )
    {
        return ( string.indexOf( VARIABLE_START_DELIM + variableName
                + VARIABLE_END_DELIM ) >= 0 );
    }
1028574
static boolean hasEnvironmentVariable(String variable) {
        final String value = System.getenv(variable);
        if (value != null) {
            return true;
        }
        return false;
    }
485827
function checkReferences(variable) {

            // Gets references that exist in loop conditions.
            const conditions = variable
                .references
                .map(toLoopCondition)
                .filter(Boolean);

            if (conditions.length === 0) {
                return;
            }

            // Registers the conditions to belonging groups.
            registerConditionsToGroup(conditions);

            // Check the conditions are modified.
            const modifiers = variable.references.filter(isWriteReference);

            if (modifiers.length > 0) {
                updateModifiedFlag(conditions, modifiers);
            }

            /*
             * Reports the conditions which are not belonging to groups.
             * Others will be reported after all variables are done.
             */
            conditions
                .filter(isUnmodifiedAndNotBelongToGroup)
                .forEach(report);
        }
491377
public BDD exists(final Collection<Variable> variables) {
    final BDD resBDD = this.factory.build(this.factory.getF().and(variables));
    return new BDD(this.factory.underlyingKernel().exists(index(), resBDD.index()), this.factory);
  }
1020099
def evaluate_expression(expression, vars):
    ''''''
    try:
        v = eval(expression, globals(), vars)
    except NameError:
        return None
    except ZeroDivisionError:
        return None
    return v