code: def get_config_directory() -> Path:
      """
      Get NNI config directory.
      Create it if not exist.
      """
      if os.getenv("NNI_CONFIG_DIR") is not None:
          config_dir = Path(os.getenv("NNI_CONFIG_DIR"))  # type: ignore
      elif (
          sys.prefix != sys.base_prefix
          or Path(sys.prefix, "conda-meta").is_dir()
      ):
          config_dir = Path(sys.prefix, "nni")
      elif sys.platform == "win32":
          config_dir = Path(os.environ["APPDATA"], "nni")
      else:
          config_dir = Path.home() / ".config/nni"
      config_dir.mkdir(parents=True, exist_ok=True)
      return config_dir
  
file_path: nni/nni/runtime/config.py
imports: import os
  from pathlib import Path
  import shutil
  import sys
  import nni
label_desc: Use image node_id 1 for calling a global function with example usage: get_config_directory() and returns: config_dir