code: def get_proj_dir() -> Path:
      """
      This function finds the base PROJ directory.
      """
      proj_dir_environ = os.environ.get("PROJ_DIR")
      proj_dir: Path | None = None
      if proj_dir_environ is not None:
          proj_dir = Path(proj_dir_environ)
      if proj_dir is None and INTERNAL_PROJ_DIR.exists():
          proj_dir = INTERNAL_PROJ_DIR
          print(
              f"Internally compiled directory being used {INTERNAL_PROJ_DIR}."
          )
      elif proj_dir is None and not INTERNAL_PROJ_DIR.exists():
          proj = shutil.which("proj", path=sys.prefix)
          if proj is None:
              proj = shutil.which("proj")
          if proj is None:
              raise SystemExit(
                  "proj executable not found. Please set the PROJ_DIR variable. "
                  "For more information see: "
                  "https://pyproj4.github.io/pyproj/stable/installation.html"
              )
          proj_dir = Path(proj).parent.parent
      elif proj_dir is not None and proj_dir.exists():
          print("PROJ_DIR is set, using existing PROJ installation..\n")
      else:
          raise SystemExit(
              f"ERROR: Invalid path for PROJ_DIR {proj_dir}"
          )
      return proj_dir
  
file_path: pyproj/setup.py
imports: import os
  import platform
  import re
  import shutil
  import subprocess
  import sys
  from pathlib import Path
  from setuptools import Extension, setup
label_desc: Use image node_id 4 for calling a global function with example usage: get_proj_dir() and returns: proj_dir