class_docstr: Node configuration.
  
  name: node name
  contents: a list of contents - attributes and child nodes
  See comment at the top of the configuration file for details.
class_docstr_tok: ["Node","configuration",".","name",":","node","name","contents",":","a","list","of","contents","-","attributes","and","child","nodes","See","comment","at","the","top","of","the","configuration","file","for","details","."]
code: def _gen_iter(self):
      src = "    def __iter__(self):\n"
  
      if self.all_entries:
          for child in self.child:
              src += (
                  "        if self.%(child)s is not None:\n"
                  + "            yield self.%(child)s\n"
              ) % (dict(child=child))
  
          for seq_child in self.seq_child:
              src += (
                  "        for child in (self.%(child)s or []):\n"
                  "            yield child\n"
              ) % (dict(child=seq_child))
  
          if not (self.child or self.seq_child):
              # Empty generator
              src += "        return\n" + "        yield\n"
      else:
          # Empty generator
          src += "        return\n" + "        yield\n"
  
      return src
  
file_path: catboost/contrib/python/pycparser/py3/pycparser/_ast_gen.py
imports: from string import Template
label_desc: Use image node_id 5 for calling the NodeCfg obj's underlying member method code with example usage: obj._gen_iter() and returns: src