foreach_variable : VARIABLE
                        | AND VARIABLE
185655
def p_foreach_variable(p):
    ''''''
    if len(p) == 2:
        p[0] = ast.ForeachVariable(p[1], False, lineno=p.lineno(1))
    else:
        p[0] = ast.ForeachVariable(p[2], True, lineno=p.lineno(1))
278970
def has_variable?(var)
      @stack.reverse_each do |scope|
        if SCOPE_BLOCKER_9000 == scope
          return false
        elsif scope.include?(var)
          return true
        end
      end
    end
1165223
private function variable() {
    switch ($this->currentType) {
      case T_STRING:
      case T_NS_SEPARATOR:
      case T_NAMESPACE:
        $namespace_path = $this->name();
        if ($this->currentType === '(') {
          return $this->functionCall($namespace_path);
        }
        elseif ($this->currentType === T_DOUBLE_COLON) {
          return $this->varClass($namespace_path);
        }
        break;
      case T_STATIC:
        $class_name = $this->mustMatchToken(T_STATIC);
        return $this->varClass($class_name);
      case '$':
      case T_VARIABLE:
        $var = $this->indirectReference();
        if ($this->currentType === '(') {
          return $this->functionCall($var, TRUE);
        }
        elseif (!($var instanceof VariableVariableNode) && $this->currentType === T_DOUBLE_COLON) {
          return $this->varClass($var);
        }
        else {
          return $this->objectDereference($var);
        }
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      "expected variable");
  }
146531
private function _printVar($var)
    {
        if (is_string($var)) {
            $search = array("\x00", "\x0a", "\x0d", "\x1a", "\x09");
            $replace = array('\0', '\n', '\r', '\Z', '\t');

            return ('"'.str_replace($search, $replace, $var).'"');
        } elseif (is_bool($var)) {
            if ($var) {
                return ('true');
            } else {
                return ('false');
            }
        } elseif (is_array($var)) {
            $strResult = 'array( ';
            $strComma = '';
            foreach ($var as $key=>$val) {
                $strResult .= $strComma.$this->_printVar($key).' => '.$this->_printVar($val);
                $strComma = ', ';
            }
            $strResult .= ' )';

            return ($strResult);
        }
        // anything else, just let php try to print it
        return (var_export($var, true));
    }
613022
public function getRedefinedVars(array $new_vars_in_scope, $include_new_vars = false)
    {
        $redefined_vars = [];

        foreach ($this->vars_in_scope as $var_id => $this_type) {
            if (!isset($new_vars_in_scope[$var_id])) {
                if ($include_new_vars) {
                    $redefined_vars[$var_id] = $this_type;
                }
                continue;
            }

            $new_type = $new_vars_in_scope[$var_id];

            if (!$this_type->failed_reconciliation
                && !$this_type->isEmpty()
                && !$new_type->isEmpty()
                && !$this_type->equals($new_type)
            ) {
                $redefined_vars[$var_id] = $this_type;
            }
        }

        return $redefined_vars;
    }
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
155496
def var(name)
    res = send_cmd("print #{name}").join("").chomp
    if /undefined variable:/ =~ res
      kernel_raise GnuplotError,res.strip
    end
    res
  end
1331619
def _split_variables(variables):
    
    file_vs = []
    std_vs = []
    for v in variables:
        cur_type = v["type"]
        while isinstance(cur_type, dict):
            if "items" in cur_type:
                cur_type = cur_type["items"]
            else:
                cur_type = cur_type["type"]
        if (cur_type in ["File", "null", "record"] or
              (isinstance(cur_type, (list, tuple)) and
               ("File" in cur_type or {'items': 'File', 'type': 'array'} in cur_type))):
            file_vs.append(v)
        elif v["id"] in ALWAYS_AVAILABLE:
            std_vs.append(v)
        else:
            file_vs.append(v)
    return file_vs, std_vs
277927
def parse_variables(args):
    

    if args is None:
        return {}

    def parse_variable(string):
        tokens = string.split('=')
        name = tokens[0]
        value = '='.join(tokens[1:])
        return name, value

    return {
        name: value
        for name, value in (parse_variable(v) for v in args)
    }
1170224
private function matchVariable(): bool
    {
        foreach ($this->routesVariable as $route) {
            $this->matchVariableVars($route['u']); // find variables
            if (empty($this->vars)) {
                continue; // no variable match yet
            }
            $this->control = $route['c']; // set control for this variable match

            return true; // variable match found
        }

        return false; // variable match not found
    }
1367721
def format_vars(args):
    """'"""
    variables = []
    for key, value in args.items():
        if value:
            variables += ['{0}={1}'.format(key, value)]
    return variables
1035619
protected static function __compileVar($val)
    {
        $parts = explode('.', trim($val));
        $deep = count($parts);
        if ('$widget' == $parts[0]) {
            $ret = "\$this->widget";
        } elseif ('$global' == $parts[0]) {
            $ret = "\$this->globals";
        } elseif ('$' == $parts[0]{0}) {
            $ret = "{$parts[0]}";
        } else {
            return $val;
        }
        $i = 1;
        while ($i < $deep) {
            if (false === filter_var($parts[$i], FILTER_VALIDATE_INT)) {
                $ret .= "['{$parts[$i]}']";
            } else {
                $ret .= "[{$parts[$i]}]";
            }
            $i++;
        }

        return $ret;
    }
473770
public function expEval($variable = array())
    {
        
		$terminalExpression = $this->getTerminalExpression();
		

    	if ($terminalExpression->getUri() == RulesRdf::INSTANCE_EMPTY_TERM_URI){
			$firstPart = $this->getFirstExpression()->expEval($variable) ;
			
			if($this->getLogicalOperator()->getUri() == RulesRdf::INSTANCE_AND_OPERATOR) {
				if ($firstPart == false) {
					common_Logger::i('CUT : first Expression == FALSE and OPERATOR = AND', array('Generis Expression'));
					return false;
				}
			}
			if($this->getLogicalOperator()->getUri() == RulesRdf::INSTANCE_OR_OPERATOR) {

				if ($firstPart == true) {
					common_Logger::i('CUT : first Expression == TRUE and OPERATOR = OR', array('Generis Expression'));
					return true;
				}
			}
			$secondPart = $this->getSecondExpression()->expEval($variable);

			//if both part are simple value
			if($firstPart instanceof core_kernel_classes_Container 
				&& $secondPart instanceof core_kernel_classes_Container) {
					common_Logger::d('Both Part are Container', array('Generis Expression'));
					$returnValue = $this->operatorEval($firstPart,$secondPart);	

			}
			
			//both are vector
			else if ($firstPart instanceof core_kernel_classes_ContainerCollection 
					&& $secondPart instanceof core_kernel_classes_ContainerCollection ) {
						$returnValue = false;
						foreach ($firstPart->getIterator() as $subLeftPart)
						{
							//analyse left collection and remove any container in it which is not literal
							if (!($subLeftPart instanceof core_kernel_classes_Resource))
							{
								foreach ($secondPart->getIterator() as $subRightPart)
								{
									 //analyse right collection and remove any container in it which is not literal
									if (!($subRightPart instanceof core_kernel_classes_Resource))
									//print_r($subLeftPart);print_r($subRightPart);
									{
										$returnValue = $returnValue || $this->operatorEval($subLeftPart,$subRightPart);
									}
								}
							}
						}
						//die("the evaluation is ". $returnValue);
						
						//throw new common_Exception('not implemented yet', __FILE__,__LINE__);
			}
			// first is a vector second is a value
			else if (($firstPart instanceof core_kernel_classes_ContainerCollection) 
					&& ($secondPart instanceof core_kernel_classes_Container )) {
				$tempResult = false;
				foreach ($firstPart->getIterator() as $container) {
					common_Logger::d('FirstPart Part is ContainerCollection Second is Container', array('Generis Expression'));
					//TODO For now consider that if only  one value of the table return true, 
					
					//TODO exist unique need to be added
					
					if ($this->getLogicalOperator()->getUri() != RulesRdf::INSTANCE_DIFFERENT_OPERATOR_URI)
					{
						$tempResult = $tempResult || $this->operatorEval($container,$secondPart);
					}
					else
					{
						if ($this->operatorEval($container,$secondPart))
						{
							$tempResult = true;
						}
						else
						{
							break;
							$tempResult = false;
						}
					}
				}
				$returnValue = $tempResult;
			}
			// first is a value second is a vector
			else if (($firstPart instanceof core_kernel_classes_Container) 
					&& ($secondPart instanceof core_kernel_classes_ContainerCollection )) {
				foreach ($secondPart->getIterator() as $container) {
					common_Logger::d('FirstPart Part Container is  Second is ContainerCollection', array('Generis Expression'));
					
					//TODO For now consider that all value of the table need to be equal to return true, , 
					//TODO exist unique need to be added
					$tempResult = $tempResult && $this->operatorEval($firstPart,$container);
						
				}
				$returnValue = $tempResult;
			}
			//case we compare boolean
			else {
				common_Logger::d('Both part are boolean', array('Generis Expression'));
			
				switch($this->getLogicalOperator()->getUri()) {
					case RulesRdf::INSTANCE_OR_OPERATOR : {
						$returnValue = $firstPart || $secondPart ;
						
						break;
					}
					case RulesRdf::INSTANCE_AND_OPERATOR : {
						$returnValue = $firstPart &&  $secondPart ;
						break;
					}
					default : {
						var_dump($this);
						throw new common_Exception('Expression ' . $this->getLabel() . ' do not have knowm operator');
					}
				}
			}
		}
		else {
			if ($terminalExpression != null) {
				common_Logger::d('Evaluating Terminal Expression', array('Generis Expression'));
				$returnValue = $terminalExpression->evaluate($variable);
				common_Logger::d('Result : ' . $returnValue, array('Generis Expression'));
			}
			else {
				throw new common_Exception('terminal expression is null');
			}
			
		}
		return $returnValue;
        
    }
1308265
private function parseEntitiesVariableCurly() {
		$index = $this->pos;

		if( $this->input_len > ($this->pos+1) && $this->input[$this->pos] === '@' && ($curly = $this->MatchReg('/\\G@\{([\w-]+)\}/')) ){
			return $this->NewObj3('Less_Tree_Variable',array('@'.$curly[1], $index, $this->env->currentFileInfo));
		}
	}
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
764644
def nil_instance_vars(object, vars)
    vars = Array(vars)
    vars.select { |var| object.instance_variable_get(var).nil? }
  end
520350
def _transform(self, var):
        '''  '''
        self.collection.variables.pop(var.name)
        return var.values