code: def cli_config_dir() -> Path:
      cli_config_dir = os.environ.get("CORTEX_CLI_CONFIG_DIR", "")
      if cli_config_dir == "":
          return Path.home() / ".cortex"
      return Path(cli_config_dir).expanduser().resolve()
  
imports: import os
  import shutil
  from contextlib import contextmanager
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: cli_config_dir() and returns: Path, unknown