code: def gen_script(cls, user_cfg_dict):
      # Check validation
      cls.setup_user_cfg_cls()
      cls.user_cfg_cls(**user_cfg_dict)
  
      # Training configuration
      train_cfg = torch.load(user_cfg_dict["cpt_path"])["cfg"]
  
      # Dict for code rendering
      render_cfg = deepcopy(user_cfg_dict)
      model_name = train_cfg["model_name"]
      model_code = GraphModelFactory.get_source_code(model_name)
      render_cfg["model_code"] = model_code
      render_cfg[
          "model_class_name"
      ] = GraphModelFactory.get_model_class_name(model_name)
      render_cfg.update(
          DataFactory.get_generated_code_dict(
              user_cfg_dict["data"]["name"]
          )
      )
  
      # Dict for defining cfg in the rendered code
      generated_user_cfg = deepcopy(user_cfg_dict)
      generated_user_cfg.pop("pipeline_name")
      generated_user_cfg.pop("pipeline_mode")
      # model arch configuration
      generated_user_cfg["model"] = train_cfg["model"]
  
      render_cfg["user_cfg_str"] = f"cfg = {str(generated_user_cfg)}"
      render_cfg["user_cfg"] = user_cfg_dict
  
      file_current_dir = Path(__file__).resolve().parent
      with open(file_current_dir / "graphpred.jinja-py", "r") as f:
          template = Template(f.read())
  
      return template.render(**render_cfg)
  
file_path: dgl/dglgo/dglgo/apply_pipeline/graphpred/gen.py
imports: from copy import deepcopy
  from pathlib import Path
  from typing import Optional
  import ruamel.yaml
  import torch
  import typer
  from jinja2 import Template
  from pydantic import BaseModel, Field
  from ...utils.factory import ApplyPipelineFactory, DataFactory, GraphModelFactory, PipelineBase
  from ...utils.yaml_dump import deep_convert_dict, merge_comment
label_desc: Use image node_id 5 for calling the ApplyGraphpredPipeline obj's underlying member method code with example usage: obj.gen_script(cls, user_cfg_dict) and returns: template