code: def _create_algo(algo_config, algo_type):
      if algo_config.get("name"):
          algo = create_builtin_class_instance(
              algo_config["name"],
              algo_config.get("classArgs"),
              algo_type + "s",
          )
      else:
          algo = create_customized_class_instance(algo_config)
      if algo is None:
          raise AssertionError(f"Failed to create {algo_type} instance")
      return algo
  
file_path: nni/nni/__main__.py
imports: import argparse
  import base64
  import json
  import logging
  import os
  import traceback
  from .runtime.msg_dispatcher import MsgDispatcher
  from .runtime.msg_dispatcher_base import MsgDispatcherBase
  from .tools.package_utils import create_builtin_class_instance, create_customized_class_instance
label_desc: Use image node_id 2 for calling a global function with example usage: _create_algo(algo_config, algo_type) and returns: algo