whenlist : whenlist kw_when expression kw_then expression
                | kw_when expression kw_then expression
178512
def p_whenlist(self,t):
    
    if len(t)==5: t[0] = [WhenX(t[2],t[4])]
    elif len(t)==6: t[0] = t[1] + [WhenX(t[3],t[5])]
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover
56073
def _where(self, filter_fn):
        '''  '''
        assert callable(filter_fn), 'filter_fn needs to be callable'
        return VList(i for i in self if filter_fn(i()))
16831
def parse(self, expression):
        
        if isinstance(expression, (list, dict)):
            return (True if expression else False, expression)
        if sys.version_info[0] > 2:
            self.next = self.tokenize(expression).__next__
        else:
            self.next = self.tokenize(expression).next
        self.token = self.next()
        return self.expression()
705070
def __get_attr(what, type_attr, value_attr, **kwargs):
        
        if what in kwargs:
            value = int(kwargs[what]) if type_attr == 'int' else kwargs[what]
            if value in value_attr:
                return value
702041
def p_or_p_expression(tok):
        """"""
        if len(tok) == 4:
            tok[0] = LogicalBinOpRule(tok[2], tok[1], tok[3])
        else:
            tok[0] = tok[1]
1148785
def useThis(self, *args, **kwargs):
        
        self._callback = functools.partial(self._callback, *args, **kwargs)
1171366
public ConditionalBuilder when(Object value, Matcher expression) {
        action.setConditionExpression(new HamcrestConditionExpression(expression, value));
        return this;
    }
892623
private void initExpressions()
    {
        expressions = new LinkedList<>();
        for (UriTemplateComponent c : components)
        {
            if (c instanceof Expression)
            {
                expressions.add((Expression) c);
            }
        }
    }
1155614
def encode_query_kwargs(dynamizer, kwargs):
    
    ret = {}
    for k, v in six.iteritems(kwargs):
        if '__' not in k:
            raise TypeError("Invalid query argument '%s'" % k)
        name, condition_key = k.split('__')
        # Convert ==None to IS_NULL
        if condition_key == 'eq' and is_null(v):
            condition_key = 'null'
            v = True
        # null is a special case
        if condition_key == 'null':
            ret[name] = {
                'ComparisonOperator': 'NULL' if v else 'NOT_NULL'
            }
            continue
        elif condition_key not in ('in', 'between'):
            v = (v,)
        ret[name] = {
            'AttributeValueList': [dynamizer.encode(value) for value in v],
            'ComparisonOperator': CONDITIONS[condition_key],
        }
    return ret
800039
def iff(self, *args, **kwargs):
        """"""
        if len([x for x in kwargs.values() if x is None]):
            raise CQLEngineException("None values on iff are not allowed")

        clone = copy.deepcopy(self)
        for operator in args:
            if not isinstance(operator, ConditionalClause):
                raise QueryException('{0} is not a valid query operator'.format(operator))
            clone._conditional.append(operator)

        for arg, val in kwargs.items():
            if isinstance(val, Token):
                raise QueryException("Token() values are not valid in conditionals")

            col_name, col_op = self._parse_filter_arg(arg)
            try:
                column = self.model._get_column(col_name)
            except KeyError:
                raise QueryException("Can't resolve column name: '{0}'".format(col_name))

            if isinstance(val, BaseQueryFunction):
                query_val = val
            else:
                query_val = column.to_database(val)

            operator_class = BaseWhereOperator.get_operator(col_op or 'EQ')
            operator = operator_class()
            clone._conditional.append(WhereClause(column.db_field_name, operator, query_val))

        return clone
457202
def event_at(self, when, data_tuple):
        
        return self._base.event_at(when, self.make_event_data(*data_tuple))
648178
def process_has_args(cls, kwargs):
    
    rel_definitions = cls.defined_properties(properties=False, rels=True, aliases=False)

    match, dont_match = {}, {}

    for key, value in kwargs.items():
        if key not in rel_definitions:
            raise ValueError("No such relation {0} defined on a {1}".format(key, cls.__name__))

        rhs_ident = key

        rel_definitions[key]._lookup_node_class()

        if value is True:
            match[rhs_ident] = rel_definitions[key].definition
        elif value is False:
            dont_match[rhs_ident] = rel_definitions[key].definition
        elif isinstance(value, NodeSet):
            raise NotImplementedError("Not implemented yet")
        else:
            raise ValueError("Expecting True / False / NodeSet got: " + repr(value))

    return match, dont_match
67787
def execute(self, array_in, expression, **kwargs):
        """"""

        context = self.get_context(array_in, expression, kwargs)
        context.update(kwargs)
        return ma.masked_where(self.evaluate_expression(expression, context), array_in)
101540
def query_kwargs(self):
        """"""
        self._query_kwargs = query_kwargs = {}
        query = self.query
        if query: query_kwargs = self._parse_query_str(query)
        return query_kwargs
552982
def _has_z(self, kwargs):
        '''
        
        '''
        return ((self._type == 1 or self._type ==2) and
                (('z' in kwargs) or (self._element_z in kwargs)))
840186
function(obj, func, items, func2){
					each(items, function(i, item){
						when(obj, func, item, func2)
					})
				}
967818
static void collectAllExpressions(HsqlList set, Expression e,
                                      OrderedIntHashSet typeSet,
                                      OrderedIntHashSet stopAtTypeSet) {

        if (e == null) {
            return;
        }

        if (stopAtTypeSet.contains(e.opType)) {
            return;
        }

        for (int i = 0; i < e.nodes.length; i++) {
            collectAllExpressions(set, e.nodes[i], typeSet, stopAtTypeSet);
        }

        if (typeSet.contains(e.opType)) {
            set.add(e);
        }

        if (e.subQuery != null && e.subQuery.queryExpression != null) {
            e.subQuery.queryExpression.collectAllExpressions(set, typeSet,
                    stopAtTypeSet);
        }
    }