docstr: Generates the code into file, an open file buffer.
          
docstr_tok: ["Generates","the","code","into","file",",","an","open","file","buffer","."]
code: def generate(self, file=None):
      """Generates the code into file, an open file buffer."""
      src = Template(_PROLOGUE_COMMENT).substitute(
          cfg_filename=self.cfg_filename
      )
  
      src += _PROLOGUE_CODE
      for node_cfg in self.node_cfg:
          src += node_cfg.generate_source() + "\n\n"
  
      file.write(src)
  
file_path: catboost/contrib/python/pycparser/py3/pycparser/_ast_gen.py
imports: from string import Template
label_desc: Use image node_id 2 for calling the ASTCodeGenerator obj's underlying member method code with example usage: obj.generate(file) without return types