code: def set_pythonpath_in_context(
      python_path: str, context: RuntimeEnvContext
  ):
      """Insert the path as the first entry in PYTHONPATH in the runtime env.
  
      This is compatible with users providing their own PYTHONPATH in env_vars,
      and is also compatible with the existing PYTHONPATH in the cluster.
  
      The import priority is as follows:
      this python_path arg > env_vars PYTHONPATH > existing cluster env PYTHONPATH.
      """
      if "PYTHONPATH" in context.env_vars:
          python_path += os.pathsep + context.env_vars["PYTHONPATH"]
      if "PYTHONPATH" in os.environ:
          python_path += os.pathsep + os.environ["PYTHONPATH"]
      context.env_vars["PYTHONPATH"] = python_path
  
file_path: ray/python/ray/_private/runtime_env/working_dir.py
imports: import logging
  import os
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  from ray._private.runtime_env.context import RuntimeEnvContext
  from ray._private.runtime_env.packaging import Protocol, delete_package, download_and_unpack_package, get_local_dir_from_uri, get_uri_for_directory, get_uri_for_package, parse_uri, upload_package_if_needed, upload_package_to_gcs
  from ray._private.runtime_env.plugin import RuntimeEnvPlugin
  from ray._private.utils import get_directory_size_bytes, try_to_create_directory
  from ray.exceptions import RuntimeEnvSetupError
label_desc: Use image node_id 2 for calling a global function with example usage: set_pythonpath_in_context(python_path, context) without return types