code: def get_ipython_dir() -> str:
      """Return the IPython directory location.
  
      Not imported from IPython because the IPython implementation
      ensures that a writable directory exists,
      creating a temporary directory if not.
      We don't want to trigger that when checking if migration should happen.
  
      We only need to support the IPython < 4 behavior for migration,
      so importing for forward-compatibility and edge cases is not important.
      """
      return os.environ.get(
          "IPYTHONDIR", str(Path("~/.ipython").expanduser())
      )
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  from datetime import datetime, timezone
  from pathlib import Path
  from typing import Any
  from traitlets.config.loader import JSONFileConfigLoader, PyFileConfigLoader
  from traitlets.log import get_logger
  from .application import JupyterApp
  from .paths import jupyter_config_dir, jupyter_data_dir
  from .utils import ensure_dir_exists
label_desc: Use image node_id 1 for calling a global function with example usage: get_ipython_dir() and returns: os