code: def create_customized_class_instance(class_params):
      """Create instance of customized algorithms
  
      Parameters
      ----------
      class_params: dict
          class_params should contains following keys:
              codeDirectory: code directory
              className: qualified class name
              classArgs (optional): kwargs pass to class constructor
  
      Returns: object
      -------
          Returns customized class instance.
      """
  
      code_dir = class_params.get("codeDirectory")
      qualified_class_name = class_params.get("className")
      class_args = class_params.get("classArgs")
  
      if code_dir and not os.path.isdir(code_dir):
          raise ValueError(f"Directory not found: {code_dir}")
  
      sys.path.append(code_dir)
      module_name, class_name = qualified_class_name.rsplit(".", 1)
      class_module = importlib.import_module(module_name)
      class_constructor = getattr(class_module, class_name)
  
      if class_args is None:
          class_args = {}
      instance = class_constructor(**class_args)
  
      return instance
  
file_path: nni/nni/tools/package_utils/tuner_factory.py
imports: from __future__ import annotations
  import importlib
  import os
  import sys
  from typing import Any
  from typing_extensions import Literal
  from .None import config_manager
label_desc: Use image node_id 7 for calling a global function with example usage: create_customized_class_instance(class_params) and returns: instance