Iterate over the expression in preorder.
195330
def preorder_iter(expression):
    """"""
    yield expression
    if isinstance(expression, Operation):
        for operand in op_iter(expression):
            yield from preorder_iter(operand)
339250
def to_expr( key, value, field = nil )
      Sequel.expr( predicates[key, value, field] )
    end
908704
def p_expression_eql(self, p):
        ''
        p[0] = Eql(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
192048
function (item, expression) {
            var ret = 1,
                operator = expression.operator;

            if (expression instanceof Query.Where) {
                if (operator === "or") {
                    ret = 0;
                }
                var tmp;
                for (var i = 0; i < expression.expressions.length; i++) {
                    tmp = this._filterItem(item, expression.expressions[i]);
                    if (operator === "and") {
                        ret = ret * tmp;
                    } else if (operator === "or" && tmp) {
                        return 1;
                    } else if (operator === "not") {
                        return tmp ? 0 : 1;
                    }
                }
            } else if (expression instanceof Query.Comparator) {
                // TODO: add type check
                var value = expression.value,
                    field = expression.field,
                    itemValue = this._getValueForItemField(item, field);

                if (typeof(itemValue) === "undefined") {
                    return 0;
                }

                switch (operator) {
                    case "eql":
                        return itemValue == value;
                    case "gt":
                        return itemValue > value;
                    case "lt":
                        return itemValue < value;
                    case "gte":
                        return itemValue >= value;
                    case "lte":
                        return itemValue <= value;
                    case "in":
                        if (!(itemValue instanceof Array)) {
                            itemValue = [itemValue];
                        }
                        for (var j = 0; j < itemValue.length; j++) {
                            for (var k in value) {
                                if (value.hasOwnProperty(k)) {
                                    if (itemValue[j] == value[k]) {
                                        return 1;
                                    }
                                }
                            }
                        }
                        return 0;
                    case "between":
                        return itemValue >= value[0] && itemValue <= value[1];
                    case "like":
                        return new RegExp(value, "i").test(itemValue);
                    case "ne":
                        return itemValue != value;
                    default :
                        return 1;
                }

            }

            return ret;
        }
1268428
def expressions(self):
        
        for s in self.statements:
            for expr_ in s.expressions:
                yield expr_
        yield self.next
276858
def n_term(self, node):
        """"""
        if len(node) == 1:
            self.preorder(node[0])
            node.value = node[0].value
            self.prune()
        else:
            self.preorder(node[0])
            self.preorder(node[2])
            if node[1].attr == '*':
                node.value = node[0].value * node[2].value
            elif node[1].attr == '/':
                node.value = node[0].value / node[2].value
            else:
                assert False, "Expecting operator to be '*' or '/'"
            self.prune()
        assert False, "Expecting atom to have length 1 or 3"
1117497
def _dfs_preorder(node, visited):
    """"""
    if node not in visited:
        visited.add(node)
        yield node
    if node.lo is not None:
        yield from _dfs_preorder(node.lo, visited)
    if node.hi is not None:
        yield from _dfs_preorder(node.hi, visited)
1034848
private static List<INode> preorder(INode root) {
        ArrayList<INode> result = new ArrayList<INode>();
        Deque<INode> stack = new ArrayDeque<INode>();
        stack.push(root);
        while (!stack.isEmpty()) {
            INode c = stack.pop();

            result.add(c);

            for (int i = c.getChildCount() - 1; i >= 0; i--) {
                stack.push(c.getChildAt(i));
            }
        }

        return result;
    }
572857
def product(sequence, initial=1):
    """"""
    if not isinstance(sequence, collections.Iterable):
        raise TypeError("'{}' object is not iterable".format(type(sequence).__name__))

    return reduce(operator.mul, sequence, initial)
856267
def iter(self, order='', sort=True):
        """"""
        from casacore.tables import tableiter
        return tableiter(self._table, [self._column], order, sort)
1153842
function(obj, visitor, context) {
      var result;
      this.preorder(obj, function(value, key, parent) {
        if (visitor.call(context, value, key, parent)) {
          result = value;
          return stopWalk;
        }
      }, context);
      return result;
    }
275114
function each(seq, pred, ctx) {
        return sequencep(seq)?  __each.call(seq, pred, ctx)
             : /* non-seq */    undefined
    }
746863
def p_expression_greatereq(self, p):
        ''
        p[0] = GreaterEq(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
639856
def traverse_preorder(self, leaves=True, internal=True):
        '''
        '''
        s = deque(); s.append(self)
        while len(s) != 0:
            n = s.pop()
            if (leaves and n.is_leaf()) or (internal and not n.is_leaf()):
                yield n
            s.extend(n.children)
541876
def iterator(plugins, context):
    """"""
    test = pyblish.logic.registered_test()
    state = {
        "nextOrder": None,
        "ordersWithError": set()
    }

    for plugin in plugins:
        state["nextOrder"] = plugin.order

        message = test(**state)
        if message:
            raise StopIteration("Stopped due to %s" % message)

        instances = pyblish.api.instances_by_plugin(context, plugin)
        if plugin.__instanceEnabled__:
            for instance in instances:
                yield plugin, instance

        else:
            yield plugin, None
760302
def dfs_preorder(self, reverse=False):
        """"""
        stack = deque()
        stack.append(self)
        while stack:
            node = stack.pop()
            yield node
            if hasattr(node, "childs"):
                if reverse:
                    stack.extend(node.childs)
                else:
                    stack.extend(node.childs[::-1])
557027
def pre_order(self):
        """"""
        yield self
        for child in self.children:
            for node in child.pre_order():
                yield node