code: def get_cfg_func(self):
      def config(
          data: DataFactory.filter(
              "nodepred-ns"
          ).get_dataset_enum() = typer.Option(
              ..., help="input data name"
          ),
          cfg: Optional[str] = typer.Option(
              None, help="output configuration path"
          ),
          model: NodeModelFactory.filter(
              lambda cls: hasattr(cls, "forward_block")
          ).get_model_enum() = typer.Option(..., help="Model name"),
      ):
          self.__class__.setup_user_cfg_cls()
          generated_cfg = {
              "pipeline_name": self.pipeline["name"],
              "pipeline_mode": self.pipeline["mode"],
              "device": "cpu",
              "data": {"name": data.name},
              "model": {"name": model.value},
              "general_pipeline": {"sampler": {"name": "neighbor"}},
          }
          output_cfg = self.user_cfg_cls(**generated_cfg).dict()
          output_cfg = deep_convert_dict(output_cfg)
          comment_dict = {
              "device": "Torch device name, e.g., cpu or cuda or cuda:0",
              "data": {
                  "split_ratio": "Ratio to generate split masks, for example set to [0.8, 0.1, 0.1] for 80% train/10% val/10% test. Leave blank to use builtin split in original dataset"
              },
              "general_pipeline": pipeline_comments,
              "model": NodeModelFactory.get_constructor_doc_dict(
                  model.value
              ),
          }
          comment_dict = merge_comment(output_cfg, comment_dict)
  
          # truncate length fan_out to be the same as num_layers in model
          if "num_layers" in comment_dict["model"]:
              comment_dict["general_pipeline"]["sampler"]["fan_out"] = [
                  5,
                  10,
                  15,
                  15,
                  15,
              ][: int(comment_dict["model"]["num_layers"])]
  
          if cfg is None:
              cfg = (
                  "_".join(["nodepred-ns", data.value, model.value])
                  + ".yaml"
              )
          yaml = ruamel.yaml.YAML()
          yaml.dump(comment_dict, Path(cfg).open("w"))
          print(
              "Configuration file is generated at {}".format(
                  Path(cfg).absolute()
              )
          )
  
      return config
  
imports: import copy
  from enum import Enum
  from pathlib import Path
  from typing import List, Optional, Union
  import ruamel.yaml
  import typer
  import yaml
  from jinja2 import ext, Template
  from pydantic import BaseModel, Field
  from ruamel.yaml.comments import CommentedMap
  from typing_extensions import Literal
  from ...utils.base_model import DeviceEnum, EarlyStopConfig, extract_name
  from ...utils.factory import DataFactory, NodeModelFactory, PipelineBase, PipelineFactory
  from ...utils.yaml_dump import deep_convert_dict, merge_comment
label_desc: Use image node_id 4 for calling the NodepredNsPipeline obj's underlying member method code with example usage: obj.get_cfg_func() and returns: config