Yield all nodes contained in given (power) node
343043
def nodes_in(self, name) -> iter:
        """"""
        yield from (node for node in self.all_in(name) if self.is_node(node))
150806
def parse(self, node):
        
        self._attrs = {}
        vals = []
        yielded = False

        for x in self._read_parts(node):
            if isinstance(x, Field):
                yielded = True
                x.attrs = self._attrs
                yield x
            else:
                vals.append(ustr(x).strip(' \n\t'))

        joined = ' '.join([ x for x in vals if x ])
        if joined:
            yielded = True
            yield Field(node, guess_type(joined), self._attrs)

        if not yielded:
            yield Field(node, "", self._attrs)
859207
def findall(self, name, recursive=False):
        """"""
        if self.children is not None:
            for child in self.children:
                if child.name == name:
                    yield child
                if recursive:
                    for atom in child.findall(name, True):
                        yield atom
219403
def get_nodes_by_source(self, graph, source_full_name):
        """"""
        parts = source_full_name.split('.')
        if len(parts) == 1:
            target_source, target_table = parts[0], None
        elif len(parts) == 2:
            target_source, target_table = parts
        else:  # len(parts) > 2 or len(parts) == 0
            msg = (
                'Invalid source selector value "{}". Sources must be of the '
                'form `${{source_name}}` or '
                '`${{source_name}}.${{target_name}}`'
            ).format(source_full_name)
            raise dbt.exceptions.RuntimeException(msg)

        for node, real_node in self.source_nodes(graph):
            if target_source not in (real_node.source_name, SELECTOR_GLOB):
                continue
            if target_table in (None, real_node.name, SELECTOR_GLOB):
                yield node
353708
def visit_yieldfrom(self, node):
        
        yi_val = (" " + node.value.accept(self)) if node.value else ""
        expr = "yield from" + yi_val
        if node.parent.is_statement:
            return expr

        return "(%s)" % (expr,)
622920
def visit_GeneratorExp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        return f"({self.visit(node.elt)} " \
               f"{' '.join(self.visit(gen) for gen in node.generators)})"
453213
def iflat_nodes(self, status=None, op="==", nids=None):
        
        nids = as_set(nids)

        if status is None:
            if not (nids and self.node_id not in nids):
                yield self

            for work in self:
                if nids and work.node_id not in nids: continue
                yield work
                for task in work:
                    if nids and task.node_id not in nids: continue
                    yield task
        else:
            # Get the operator from the string.
            op = operator_from_str(op)

            # Accept Task.S_FLAG or string.
            status = Status.as_status(status)

            if not (nids and self.node_id not in nids):
                if op(self.status, status): yield self

            for wi, work in enumerate(self):
                if nids and work.node_id not in nids: continue
                if op(work.status, status): yield work

                for ti, task in enumerate(work):
                    if nids and task.node_id not in nids: continue
                    if op(task.status, status): yield task
632173
def iter_tree(jottapath, JFS):
    """"""
    filedirlist = JFS.getObject('%s?mode=list' % jottapath)
    log.debug("got tree: %s", filedirlist)
    if not isinstance(filedirlist, JFSFileDirList):
        yield ( '', tuple(), tuple() )
    for path in filedirlist.tree:
        yield path
2744
def iter_search_nodes(self, **conditions):
        
        for n in self.traverse():
            conditions_passed = 0
            for key, value in six.iteritems(conditions):
                if hasattr(n, key) and getattr(n, key) == value:
                    conditions_passed +=1
            if conditions_passed == len(conditions):
                yield n
1138296
def _uptrace(nodelist, node):
    '''
    
    '''

    if node.parent_index is None:
        return
    parent = nodelist[node.parent_index]
    for x in _uptrace(nodelist, parent):
        yield x
    yield node
187413
def _preprocess_nodes_for_pydot(nodes_with_data):
    """'"""
    for (node_id, attrs) in nodes_with_data:
        if 'label' in attrs:
            yield (quote_for_pydot(node_id),
                   {'label': quote_for_pydot(attrs['label'])})
        else:
            yield (quote_for_pydot(node_id), {})
643078
def powernode_data(self, name:str) -> Powernode:
        """"""
        self.assert_powernode(name)
        contained_nodes = frozenset(self.nodes_in(name))
        return Powernode(
            size=len(contained_nodes),
            contained=frozenset(self.all_in(name)),
            contained_pnodes=frozenset(self.powernodes_in(name)),
            contained_nodes=contained_nodes,
        )
688970
def each_node(&block)
      return to_enum :each_node unless block_given?
      children_nodes.each do |child|
        child.each_node(&block)
      end
      yield self
      self
    end
289402
def _traverse_nodes(self):
        
        node = self.root
        stack = []
        while stack or node is not None:
            if node is not None:
                stack.append(node)
                node = node.left
            else:
                node = stack.pop()
                yield node
                node = node.right
312725
function writeNode(node, c, end) {
      var toYield = [];
      forEach(simplifyDOM(node, end), function(part) {
        toYield.push(insertPart(part));
      });
      return yield(toYield.join(""), c);
    }
122230
async def power(source, exponent):
    """"""
    async with streamcontext(source) as streamer:
        async for item in streamer:
            yield item ** exponent
1279279
def dfs(self):
        
        for node in self.children:
            for v in node.dfs:
                yield v
        yield self