code: def test_get_conda_env_dir(tmp_path):
      """
      Typical output of `conda env list`, for context:
  
      base                 /Users/scaly/anaconda3
      my_env_1             /Users/scaly/anaconda3/envs/my_env_1
  
      For this test, `tmp_path` is a stand-in for `Users/scaly/anaconda3`.
      """
  
      # Simulate starting in an env named tf1.
      d = tmp_path / "envs" / "tf1"
      Path.mkdir(d, parents=True)
      with mock.patch.dict(
          os.environ,
          {"CONDA_PREFIX": str(d), "CONDA_DEFAULT_ENV": "tf1"},
      ):
          with pytest.raises(ValueError):
              # Env tf2 should not exist.
              env_dir = get_conda_env_dir("tf2")
          tf2_dir = tmp_path / "envs" / "tf2"
          Path.mkdir(tf2_dir, parents=True)
          env_dir = get_conda_env_dir("tf2")
          assert env_dir == str(tmp_path / "envs" / "tf2")
  
      # Simulate starting in (base) conda env.
      with mock.patch.dict(
          os.environ,
          {"CONDA_PREFIX": str(tmp_path), "CONDA_DEFAULT_ENV": "base"},
      ):
          with pytest.raises(ValueError):
              # Env tf3 should not exist.
              env_dir = get_conda_env_dir("tf3")
          # Env tf2 still should exist.
          env_dir = get_conda_env_dir("tf2")
          assert env_dir == str(tmp_path / "envs" / "tf2")
  
imports: import os
  import platform
  from pathlib import Path
  import pytest
  import subprocess
  import sys
  import tempfile
  import time
  from typing import List
  from unittest import mock
  import yaml
  import ray
  from ray.runtime_env import RuntimeEnv
  from ray._private.runtime_env.conda import inject_dependencies, _inject_ray_to_conda_site, _resolve_install_from_source_ray_dependencies, _current_py_version
  from ray._private.runtime_env.conda_utils import get_conda_env_list
  from ray._private.test_utils import run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition, chdir
  from ray._private.utils import get_conda_env_dir, get_conda_bin_executable, try_to_create_directory
label_desc: Use image node_id 8 for calling a global function with example usage: test_get_conda_env_dir(tmp_path) without return types