code: def test_get_data_dir__from_user(projdir_type, tmp_path):
      tmpdir = tmp_path / "proj"
      tmpdir.mkdir()
      tmpdir_env = tmp_path / "proj_env"
      tmpdir_env.mkdir()
      with proj_env(), patch.dict(
          os.environ, {"PROJ_DATA": str(tmpdir_env)}, clear=True
      ), patch(
          "pyproj.datadir.Path.absolute",
          return_value=tmpdir / "datadir.py",
      ), patch(
          "pyproj.datadir.sys.prefix", str(tmpdir_env)
      ):  # noqa: E501
          create_projdb(tmpdir)
          create_projdb(tmpdir_env)
          set_data_dir(projdir_type(tmpdir))
          internal_proj_dir = tmpdir / "proj_dir" / "share" / "proj"
          internal_proj_dir.mkdir(parents=True)
          create_projdb(internal_proj_dir)
          assert get_data_dir() == str(tmpdir)
  
imports: import logging
  import os
  from contextlib import contextmanager
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  import pyproj._datadir
  from pyproj import CRS, Transformer, get_codes, set_use_global_context
  from pyproj._datadir import _pyproj_global_context_initialize
  from pyproj.datadir import DataDirError, append_data_dir, get_data_dir, get_user_data_dir, set_data_dir
  from pyproj.enums import PJType
  from pyproj.exceptions import CRSError
  from test.conftest import proj_env
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_data_dir__from_user(projdir_type, tmp_path) without return types