code: def test_task_conda_env_validation_cached(conda_envs, shutdown_only):
      """Verify that when a task is running with the same conda env
      it doesn't validate if env exists.
      """
      # The first run would be slower because we need to validate
      # if the package exists.
      ray.init()
      version = EMOJI_VERSIONS[0]
      runtime_env = {"conda": f"package-{version}"}
      task = get_emoji_version.options(runtime_env=runtime_env)
      s = time.time()
      ray.get(task.remote())
      first_run = time.time() - s
      # Typically takes 1~2 seconds.
      print("First run took", first_run)
  
      # We should verify this doesn't happen
      # from the second run.
      s = time.time()
      for _ in range(10):
          ray.get(task.remote())
      second_10_runs = time.time() - s
      # Typicall takes less than 100ms.
      print("second 10 runs took", second_10_runs)
      assert second_10_runs < first_run
  
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 5 for calling a global function with example usage: test_task_conda_env_validation_cached(conda_envs, shutdown_only) without return types