code: def test_conda_pip_extras_ray_serve(shutdown_only, option):
      """Tests that ray[extras] can be included as a conda/pip dependency."""
      ray.init()
      pip = ["pip-install-test==0.5", "ray[serve]"]
      if option == "conda":
          runtime_env = {
              "conda": {"dependencies": ["pip", {"pip": pip}]}
          }
      elif option == "pip":
          runtime_env = {"pip": pip}
      else:
          assert False, f"Unknown option: {option}"
  
      @ray.remote
      def f():
          import pip_install_test  # noqa
  
          return True
  
      with pytest.raises(ModuleNotFoundError):
          # Ensure pip-install-test is not installed on the test machine
          import pip_install_test  # noqa
      with pytest.raises(ray.exceptions.RayTaskError) as excinfo:
          ray.get(f.remote())
      assert "ModuleNotFoundError" in str(excinfo.value)
      assert ray.get(f.options(runtime_env=runtime_env).remote())
  
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 14 for calling a global function with example usage: test_conda_pip_extras_ray_serve(shutdown_only, option) and returns: True