Yields all direct children/younger siblings. Starts with {#first}, if
 set.
 @yieldparam config [Config]
777841
def each
      current = first()
      return if current.nil?
      yield current
      current_delegate = current.ffi_delegate
      while current_delegate = current_delegate.next
        break if current_delegate.null?
        yield CZTop::Config.from_ffi_delegate(current_delegate)
      end
    end
1270507
def depth_first_recurse(node = nil, depth = 0, &block)
      node = self if node == nil
      yield node, depth
      node.children.each do |child|
        depth_first_recurse(child, depth+1, &block)
      end
    end
17874
function flattenNodeGenerator(node, parent, index, settings, stack) {
  const { itemsKey, idKey } = settings;

  return function flattenNode(list) {
    node = settings.initNode(node);
    node[idKey] = node[idKey] || settings.generateUniqueId();
    list.push(node);

    if (node[itemsKey]) {
      for (let i = 0, len = node[itemsKey].length; i < len; i++) {
        stack.push(
          flattenNodeGenerator(
            node[itemsKey][i],
            node,
            i,
            settings,
            stack
          )
        );
      }
    }

    if (parent && parent[itemsKey]) {
      // Records children' id
      parent[itemsKey][index] = node[idKey];
      node.parent = parent[idKey];
    }

    return list;
  };
}
1327758
def each
      (1..ROWS).each do |r|
        (1..COLS).each do |c|
          yield(r, c, self[r, c])
        end
      end
    end
403926
def _children(self):
        """"""
        if self.method_of:
            yield self.method_of
        for codeobj in self.arguments:
            if isinstance(codeobj, CodeExpression):
                yield codeobj
454094
private function yieldAllConfig()
    {
        $this->allConfig = $this->allConfig ?: $this->getAllConfigNames();
        foreach ($this->allConfig as $name) {
            yield $name;
        }
    }
287532
def leaves(self, cls, level=0, intermediate=False):
        
        if intermediate:
            if isinstance(self, cls):
                yield self, level
        elif len(self.children) == 0:
            if isinstance(self, cls):
                yield self, level
            else:
                raise StopIteration

        for child in self.children:
            for leaf, _level in child.leaves(cls, level + 1, intermediate=intermediate):
                    yield leaf, _level
1333346
def each_recursive(&block) # :yields: node
      self.elements.each {|node|
        block.call(node)
        node.each_recursive(&block)
      }
    end
352410
function processChildren( &$textElements,
                              &$children, $key, &$item, &$index, &$isFirstRun,
                              &$delimiterStructure, &$sequenceStructure, &$filterStructure,
                              $tpl, $rootNamespace, $name, $functionPlacement,
                              &$variableIterator, $noLastValue,
                              &$iteratorData )
    {
        if ( $variableIterator !== null )
        {
            unset( $last );
            if ( !$noLastValue and $iteratorData['iterator'] !== false )
            {
                $last =& $iteratorData['iterator'];
            }
            else
            {
                $last = false;
            }
            unset( $iteratorData['iterator'] );
            $iteratorData['iterator'] = new eZTemplateSectionIterator();
            $iteratorData['iterator']->setIteratorValues( $item, $key, $index, $index + 1, false, $last );
            unset( $last );

            $iteratorObject =& $iteratorData['iterator'];
            $tpl->setVariable( $variableIterator, $iteratorObject, $name );
        }
        else
        {
            $tpl->setVariable( "key", $key, $name );
            $tpl->setVariable( "item", $item, $name );
            $tpl->setVariable( "index", $index, $name );
            $tpl->setVariable( "number", $index + 1, $name );
        }
        if ( count( $filterStructure ) > 0 )
        {
            $filterCount = count( $filterStructure );
            $includeElement = true;
            for ( $i = 0; $i < $filterCount; ++$i )
            {
                $filterElement =& $filterStructure[$i];
                $filterParameters =& $filterElement[3];
                $filterName = $filterElement[2];
                $filterMatch = null;
                if ( isset( $filterParameters["match"] ) )
                {
                    $filterMatch = $tpl->elementValue( $filterParameters["match"], $rootNamespace, $name, $functionPlacement );
                    if ( $filterMatch )
                        $includeElement = $filterName == "section-exclude" ? false : true;
                }
                else
                    $tpl->missingParameter( "section:$filterName", "match" );
            }
            if ( !$includeElement )
                return false;
        }
        if ( $delimiterStructure !== null and !$isFirstRun )
        {
            $delimiterParameters = $delimiterStructure[3];
            $delimiterMatch = true;
            if ( isset( $delimiterParameters["modulo"] ) )
            {
                $delimiterModulo = $delimiterParameters["modulo"];
                $modulo = $tpl->elementValue( $delimiterModulo, $rootNamespace, $name, $functionPlacement );
                $modulo = trim( $modulo );
                if ( is_numeric( $modulo ) )
                    $delimiterMatch = ( $index % $modulo ) == 0;
            }
            if ( isset( $delimiterParameters["match"] ) )
            {
                $delimiterMatchParameter = $delimiterParameters["match"];
                $delimiterMatch = $tpl->elementValue( $delimiterMatchParameter, $rootNamespace, $name, $functionPlacement );
            }
            if ( $delimiterMatch )
            {
                $delimiterChildren =& $delimiterStructure[1];
                if ( is_array( $delimiterChildren ) )
                {
                    foreach ( array_keys( $delimiterChildren ) as $delimiterChildKey )
                    {
                        $delimiterChild =& $delimiterChildren[$delimiterChildKey];
                        $tpl->processNode( $delimiterChild, $textElements, $rootNamespace, $name );
                    }
                }
            }
        }
        $isFirstRun = false;
        if ( $sequenceStructure !== null and is_array( $sequenceStructure ) )
        {
            $sequenceValue = array_shift( $sequenceStructure );
            if ( $variableIterator !== null )
            {
                $iteratorData['iterator']->setSequence( $sequenceValue );
            }
            else
            {
                $tpl->setVariable( "sequence", $sequenceValue, $name );
            }
            $sequenceStructure[] = $sequenceValue;
        }
        foreach ( array_keys( $children ) as $childKey )
        {
            $child =& $children[$childKey];
            $tpl->processNode( $child, $textElements, $rootNamespace, $name );
        }
        ++$index;
        return true;
    }
1312331
def children(opt = {})
      raise ArgumentError, '#children can not take an index value' if opt[:index]

      xpath_adjacent(opt.merge(adjacent: :child, plural: true))
    end
236231
def walk(self, cli):
        
        yield self
        for c in self.children:
            for i in c.walk(cli):
                yield i
476788
def method_missing name, *values, &block
      return @_items.send( name, *values, &block ) if @_items.respond_to? name     # @_items methods are highest priority

      name = name.to_s.chomp('=')

      if block_given?                                                  # block is a nested configuration
        if block.arity == 1                                            # yield DSL needs deferred block to set parent without binding
          return _set name, Configuration.new_defer_block_for_parent( self, @_options, &block )
        else
          return _set name, Configuration.new( nil, @_options, &block ) # eval DSL can set parent from block binding in initialize
        end
      end

      return _get name if values.empty?                               # just get item
      return _set name, values if values.size > 1                     # set item to multiple values
      return _set name, values.first                                  # set item to single value
    end
58338
def iter_breadth_first(self, root=None):
        
        if root == None:
            root = self
        yield root
        last = root 
        for node in self.iter_breadth_first(root):
            if isinstance(node, DictCell):
                # recurse
                for subpart in node:
                    yield subpart
                    last = subpart
            if last == node:
                return
1346158
def iteritems_breadth_first(a_mapping, include_dicts=False):
    """"""
    subordinate_mappings = []
    for key, value in six.iteritems(a_mapping):
        if isinstance(value, collections.Mapping):
            subordinate_mappings.append((key, value))
            if include_dicts:
                yield key, value
        else:
            yield key, value
    for key, a_map in subordinate_mappings:
        for sub_key, value in iteritems_breadth_first(a_map, include_dicts):
            yield '%s.%s' % (key, sub_key), value
758790
def all_child_sprites(self):
        """"""
        for sprite in self.sprites:
            for child_sprite in sprite.all_child_sprites():
                yield child_sprite
            yield sprite
1202068
def each
      root.each do |node, mode, stack|
        if mode == :on_enter
          yield(node.blob_address, node.size)
        end
      end
    end
1063464
def first(self, **kwargs):
        
        result = yield self.get(**kwargs)

        if not result['rows']:
            raise exceptions.NotFound()

        raise Return(result['rows'][0])