code: def generate(node, environment, name, filename, stream=None,
               defer_init=False, optimized=True):
      
      if not isinstance(node, nodes.Template):
          raise TypeError('Can\'t compile non template nodes')
      generator = environment.code_generator_class(environment, name, filename,
                                                   stream, defer_init,
                                                   optimized)
      generator.visit(node)
      if stream is None:
          return generator.stream.getvalue()
docs: Generate the python source for a node tree.