code: def dict_factory(obj):
      ret = {}
      for k, v in obj:
          if k.startswith("_"):
              continue
          if v is None:
              continue
          words = k.split("_")
          camel_k = words[0] + "".join(
              word.title() for word in words[1:]
          )
          ret[camel_k] = v
      return ret
  
file_path: nni/nni/tools/nni_manager_scripts/collect_gpu_info.py
imports: from __future__ import annotations
  from dataclasses import asdict, dataclass
  import json
  import sys
  from typing import Any, Literal
  from pynvml import *
label_desc: Use image node_id 2 for calling a global function with example usage: dict_factory(obj) and returns: ret