Yield all columns in the condition or its inner conditions.

    Unwraps proxies when the condition's column (or any of its values) include paths.
338098
def iter_columns(condition):
    
    # Like iter_conditions, this can't live in each condition without going possibly infinite on the
    # recursion, or passing the visited set through every call.  That makes the signature ugly, so we
    # take care of it here.  Luckily, it's pretty easy to leverage iter_conditions and just unpack the
    # actual columns.
    visited = set()
    for condition in iter_conditions(condition):
        if condition.operation in ("and", "or", "not"):
            continue
        # Non-meta conditions always have a column, and each of values has the potential to be a column.
        # Comparison will only have a list of len 1, but it's simpler to just iterate values and check each

        # unwrap proxies created for paths
        column = proxied(condition.column)

        # special case for None
        # this could also have skipped on isinstance(condition, Condition)
        # but this is slightly more flexible for users to create their own None-sentinel Conditions
        if column is None:
            continue
        if column not in visited:
            visited.add(column)
            yield column
            for value in condition.values:
                if isinstance(value, ComparisonMixin):
                    if value not in visited:
                        visited.add(value)
                        yield value
934163
def flatten_once(iterable, check=is_iterable):
    """"""
    for value in iterable:
        if check(value):
            for item in value:
                yield item
        else:
            yield value
972101
protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception {
        int shardCount = config.getShardCount();

        List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>();
        for (int i = 0; i < shardCount; i++) {
            futures.add(cassandra.selectAsync(generateSelectByShardCql(columns, i)));
        }

        List<Row<String, String>> rows = new LinkedList<Row<String, String>>();
        for (Future<Rows<String, String>> f: futures) {
            Rows<String, String> shardRows = f.get();
            Iterables.addAll(rows, shardRows);
        }

        return rows;
    }
927343
def _AtNonLeaf(self, attr_value, path):
    """"""
    try:
      # Check first for iterables
      # If it's a dictionary, we yield it
      if isinstance(attr_value, dict):
        yield attr_value
      else:
        # If it's an iterable, we recurse on each value.
        for sub_obj in attr_value:
          for value in self.Expand(sub_obj, path[1:]):
            yield value
    except TypeError:  # This is then not iterable, we recurse with the value
      for value in self.Expand(attr_value, path[1:]):
        yield value
1145240
def iter(self, query, *parameters, **kwargs):
        """"""
        cursor = self._cursor()
        try:
            self._execute(cursor, query, parameters or None, kwargs)
            if cursor.description:
                column_names = [column.name for column in cursor.description]
                while True:
                    record = cursor.fetchone()
                    if not record:
                        break
                    yield Row(zip(column_names, record))
            raise StopIteration

        except:
            cursor.close()
            raise
1132441
def filter(self, node, condition):
        

        if not isinstance(node, Node):
            raise TypeError('not a node')

        for child in node:
            if condition(child):
                yield child
            for subchild in self.filter(child, condition):
                yield subchild
571893
def leaves(self, column_name):
        
        clean_name = unnest_path(column_name)

        if clean_name != column_name:
            clean_name = column_name
            cleaner = lambda x: x
        else:
            cleaner = unnest_path


        columns = self.columns
        # TODO: '.' IMPLIES ALL FIELDS FROM ABSOLUTE PERPECTIVE, ALL OTHERS ARE A RELATIVE PERSPECTIVE
        # TODO: HOW TO REFER TO FIELDS THAT MAY BE SHADOWED BY A RELATIVE NAME?
        for path in reversed(self.query_path) if clean_name == '.' else self.query_path:
            output = [
                c
                for c in columns
                if (
                    (c.name != "_id" or clean_name == "_id") and
                    (
                        (c.jx_type == EXISTS and column_name.endswith("." + EXISTS_TYPE)) or
                        c.jx_type not in OBJECTS or
                        (clean_name == '.' and c.cardinality == 0)
                    ) and
                    startswith_field(cleaner(relative_field(c.name, path)), clean_name)
                )
            ]
            if output:
                return set(output)
        return set()
17596
def visit_yield(self, node, parent):
        """"""
        newnode = nodes.Yield(node.lineno, node.col_offset, parent)
        if node.value is not None:
            newnode.postinit(self.visit(node.value, newnode))
        return newnode
345680
public Map<Column, List<Condition>> getConditionsMap() {
        Map<Column, List<Condition>> result = new LinkedHashMap<>(conditions.size(), 1);
        for (Condition each : conditions) {
            if (!result.containsKey(each.getColumn())) {
                result.put(each.getColumn(), new LinkedList<Condition>());
            }
            result.get(each.getColumn()).add(each);
        }
        return result;
    }
146340
def parse_condition(
    cond, selectable, aggregated=False, default_aggregation='sum'
):
    """"""
    if cond is None:
        return None

    else:
        if 'and' in cond:
            conditions = [
                parse_condition(
                    c, selectable, aggregated, default_aggregation
                ) for c in cond['and']
            ]
            return and_(*conditions)
        elif 'or' in cond:
            conditions = [
                parse_condition(
                    c, selectable, aggregated, default_aggregation
                ) for c in cond['or']
            ]
            return or_(*conditions)
        elif 'field' not in cond:
            raise BadIngredient('field must be defined in condition')
        field = parse_field(
            cond['field'],
            selectable,
            aggregated=aggregated,
            default_aggregation=default_aggregation
        )
        if 'in' in cond:
            value = cond['in']
            if isinstance(value, dict):
                raise BadIngredient('value for in must be a list')
            condition_expression = getattr(field, 'in_')(tuple(value))
        elif 'gt' in cond:
            value = cond['gt']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__gt__')(value)
        elif 'gte' in cond:
            value = cond['gte']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__ge__')(value)
        elif 'lt' in cond:
            value = cond['lt']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__lt__')(value)
        elif 'lte' in cond:
            value = cond['lte']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__le__')(value)
        elif 'eq' in cond:
            value = cond['eq']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__eq__')(value)
        elif 'ne' in cond:
            value = cond['ne']
            if isinstance(value, (list, dict)):
                raise BadIngredient('conditional value must be a scalar')
            condition_expression = getattr(field, '__ne__')(value)
        else:
            raise BadIngredient('Bad condition')

        return condition_expression
39416
def get_tree(cls, *condition, **kwargs):
        
        parent_field = kwargs.pop('parent_field', 'parent')
        parent = kwargs.pop('parent', None)
        parent_order_by = kwargs.pop('parent_order_by', None)
        current = kwargs.pop('current', None)
        order_by = kwargs.pop('order_by', None)
        id_field = kwargs.pop('id_field', 'id')
        mode = kwargs.pop('mode', 'wide')
        if mode not in ('wide', 'deep'):
            raise Exception("mode parameter should be 'wide' or 'deep', but '{}' found.".format(mode))

        def _f(parent):
            query = cls.filter(cls.c[parent_field]==parent, *condition)
            if order_by is not None:
                query.order_by(order_by)
            for row in query:
                if mode == 'wide':
                    yield row
                for _row in _f(getattr(row, id_field)):
                    yield _row
                if mode == 'deep':
                    yield row

        if current:
            query = cls.filter(cls.c[id_field]==current)
        else:
            if is_condition(parent):
                query = cls.filter(parent)
            else:
                query = cls.filter(cls.c[parent_field]==parent)
        if parent_order_by is not None:
            query.order_by(parent_order_by)
        for row in query:
            if mode == 'wide':
                yield row
            for r in _f(getattr(row, id_field)):
                yield r
            if mode == 'deep':
                yield row
1327758
def each
      (1..ROWS).each do |r|
        (1..COLS).each do |c|
          yield(r, c, self[r, c])
        end
      end
    end
873283
def col_iter(self):
        """"""
        for k in utils.range_(self.side):
            yield self.col(k)
1096072
def formulas_iter(self):
        
        for var in it.ifilter(self.has_node, self.variables()):
            yield var, frozenset(self.predecessors(var))
914818
def iterrows(self):
        """"""



        row_proxy = None

        headers = None

        for row in self:

            if not headers:
                headers = row
                row_proxy = RowProxy(headers)
                continue

            yield row_proxy.set_row(row)
428278
def fields(iterable, fields=None):
    
    if not fields:
        for item in iterable:
            yield item

    prepared_fields = _prepare_fields(fields)

    for item in iterable:
        yield _process_fields(item, prepared_fields)
785073
def fetch(self, end=values.unset, start=values.unset):
        
        return self._proxy.fetch(end=end, start=start, )