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_children(self):
      src = "    def children(self):\n"
  
      if self.all_entries:
          src += "        nodelist = []\n"
  
          for child in self.child:
              src += (
                  "        if self.%(child)s is not None:"
                  + ' nodelist.append(("%(child)s", self.%(child)s))\n'
              ) % (dict(child=child))
  
          for seq_child in self.seq_child:
              src += (
                  "        for i, child in enumerate(self.%(child)s or []):\n"
                  '            nodelist.append(("%(child)s[%%d]" %% i, child))\n'
              ) % (dict(child=seq_child))
  
          src += "        return tuple(nodelist)\n"
      else:
          src += "        return ()\n"
  
      return src
  
file_path: catboost/contrib/python/pycparser/py2/pycparser/_ast_gen.py
imports: from string import Template
label_desc: Use image node_id 4 for calling the NodeCfg obj's underlying member method code with example usage: obj._gen_children() and returns: src