code: def get_callable_kwargs(
      config: InstConf, default_module: Union[str, ModuleType] = None
  ) -> (type, dict):
      """
      extract class/func and kwargs from config info
  
      Parameters
      ----------
      config : [dict, str]
          similar to config
          please refer to the doc of init_instance_by_config
  
      default_module : Python module or str
          It should be a python module to load the class type
          This function will load class from the config['module_path'] first.
          If config['module_path'] doesn't exists, it will load the class from default_module.
  
      Returns
      -------
      (type, dict):
          the class/func object and it's arguments.
  
      Raises
      ------
          ModuleNotFoundError
      """
      if isinstance(config, dict):
          key = "class" if "class" in config else "func"
          if isinstance(config[key], str):
              # 1) get module and class
              # - case 1): "a.b.c.ClassName"
              # - case 2): {"class": "ClassName", "module_path": "a.b.c"}
              m_path, cls = split_module_path(config[key])
              if m_path == "":
                  m_path = config.get("module_path", default_module)
              module = get_module_by_module_path(m_path)
  
              # 2) get callable
              _callable = getattr(
                  module, cls
              )  # may raise AttributeError
          else:
              _callable = config[
                  key
              ]  # the class type itself is passed in
          kwargs = config.get("kwargs", {})
      elif isinstance(config, str):
          # a.b.c.ClassName
          m_path, cls = split_module_path(config)
          module = get_module_by_module_path(
              default_module if m_path == "" else m_path
          )
  
          _callable = getattr(module, cls)
          kwargs = {}
      else:
          raise NotImplementedError(
              f"This type of input is not supported"
          )
      return _callable, kwargs
  
file_path: qlib/qlib/utils/mod.py
imports: import contextlib
  import importlib
  import os
  from pathlib import Path
  import pickle
  import pkgutil
  import re
  import sys
  from types import ModuleType
  from typing import Any, Dict, List, Tuple, Union
  from urllib.parse import urlparse
  from qlib.typehint import InstConf
label_desc: Use image node_id 3 for calling a global function with example usage: get_callable_kwargs(config, default_module) and returns: _callable,  kwargs