code: def auto_init(**kwargs):
      """
      This function will init qlib automatically with following priority
      - Find the project configuration and init qlib
          - The parsing process will be affected by the `conf_type` of the configuration file
      - Init qlib with default config
      - Skip initialization if already initialized
  
      :**kwargs: it may contain following parameters
                  cur_path: the start path to find the project path
  
      Here are two examples of the configuration
  
      Example 1)
      If you want to create a new project-specific config based on a shared configure, you can use  `conf_type: ref`
  
      .. code-block:: yaml
  
          conf_type: ref
          qlib_cfg: '<shared_yaml_config_path>'    # this could be null reference no config from other files
          # following configs in `qlib_cfg_update` is project=specific
          qlib_cfg_update:
              exp_manager:
                  class: "MLflowExpManager"
                  module_path: "qlib.workflow.expm"
                  kwargs:
                      uri: "file://<your mlflow experiment path>"
                      default_exp_name: "Experiment"
  
      Example 2)
      If you want to create simple a standalone config, you can use following config(a.k.a. `conf_type: origin`)
  
      .. code-block:: python
  
          exp_manager:
              class: "MLflowExpManager"
              module_path: "qlib.workflow.expm"
              kwargs:
                  uri: "file://<your mlflow experiment path>"
                  default_exp_name: "Experiment"
  
      """
      kwargs["skip_if_reg"] = kwargs.get("skip_if_reg", True)
  
      try:
          pp = get_project_path(cur_path=kwargs.pop("cur_path", None))
      except FileNotFoundError:
          init(**kwargs)
      else:
          logger = get_module_logger("Initialization")
          conf_pp = pp / "config.yaml"
          with conf_pp.open() as f:
              conf = yaml.safe_load(f)
  
          conf_type = conf.get("conf_type", "origin")
          if conf_type == "origin":
              # The type of config is just like original qlib config
              init_from_yaml_conf(conf_pp, **kwargs)
          elif conf_type == "ref":
              # This config type will be more convenient in following scenario
              # - There is a shared configure file, and you don't want to edit it inplace.
              # - The shared configure may be updated later, and you don't want to copy it.
              # - You have some customized config.
              qlib_conf_path = conf.get("qlib_cfg", None)
  
              # merge the arguments
              qlib_conf_update = conf.get("qlib_cfg_update", {})
              for k, v in kwargs.items():
                  if k in qlib_conf_update:
                      logger.warning(
                          f"`qlib_conf_update` from conf_pp is override by `kwargs` on key '{k}'"
                      )
              qlib_conf_update.update(kwargs)
  
              init_from_yaml_conf(qlib_conf_path, **qlib_conf_update)
          logger.info(f"Auto load project config: {conf_pp}")
  
file_path: qlib/qlib/__init__.py
imports: from pathlib import Path
  import os
  from typing import Union
  import yaml
  import logging
  import platform
  import subprocess
  from .log import get_module_logger
label_desc: Use image node_id 5 for calling a global function with example usage: auto_init() without return types