code: def render_source(output_dir, package_spec, jenv=JENV):
    
    path, name = package_spec.filepath
    directory = output_dir
    destination_filename = "%s/%s.py" % (directory, name)
    py_template = jenv.get_template(TEMPLATE_NAME)
    module_path = ".".join(package_spec.identifier.split(".")[1:-1])
    includes = [".".join(i.split(".")[:-1]) for i in package_spec.includes]
    includes = [i for i in includes if i != "types"]
    print(destination_filename, includes)
    with open(destination_filename, 'w') as f:
      f.write(py_template.render(msgs=package_spec.definitions,
                                 filepath="/".join(package_spec.filepath) + ".yaml",
                                 module_path=module_path,
                                 include=includes,
                                 timestamp=package_spec.creation_timestamp,
                                 description=package_spec.description))
docs: Render and output