class_docstr: A context used to describe the created runtime env.
code: def exec_worker(
      self, passthrough_args: List[str], language: Language
  ):
      update_envs(self.env_vars)
  
      if language == Language.PYTHON and sys.platform == "win32":
          executable = [self.py_executable]
      elif language == Language.PYTHON:
          executable = ["exec", self.py_executable]
      elif language == Language.JAVA:
          executable = ["java"]
          ray_jars = os.path.join(get_ray_jars_dir(), "*")
  
          local_java_jars = []
          for java_jar in self.java_jars:
              local_java_jars.append(f"{java_jar}/*")
              local_java_jars.append(java_jar)
  
          class_path_args = [
              "-cp",
              ray_jars + ":" + str(":".join(local_java_jars)),
          ]
          passthrough_args = class_path_args + passthrough_args
      elif sys.platform == "win32":
          executable = []
      else:
          executable = ["exec"]
  
      # By default, raylet uses the path to default_worker.py on host.
      # However, the path to default_worker.py inside the container
      # can be different. We need the user to specify the path to
      # default_worker.py inside the container.
      default_worker_path = self.container.get("worker_path")
      if self.container and default_worker_path:
          logger.debug(
              f"Changing the default worker path from {passthrough_args[0]} to "
              f"{default_worker_path}."
          )
          passthrough_args[0] = default_worker_path
  
      if sys.platform == "win32":
          cmd = [*self.command_prefix, *executable, *passthrough_args]
          logger.debug(f"Exec'ing worker with command: {cmd}")
          subprocess.Popen(cmd, shell=True).wait()
      else:
          # We use shlex to do the necessary shell escape
          # of special characters in passthrough_args.
          passthrough_args = [shlex.quote(s) for s in passthrough_args]
          cmd = [*self.command_prefix, *executable, *passthrough_args]
          # TODO(SongGuyang): We add this env to command for macOS because it doesn't
          # work for the C++ process of `os.execvp`. We should find a better way to
          # fix it.
          MACOS_LIBRARY_PATH_ENV_NAME = "DYLD_LIBRARY_PATH"
          if MACOS_LIBRARY_PATH_ENV_NAME in os.environ:
              cmd.insert(
                  0,
                  f"{MACOS_LIBRARY_PATH_ENV_NAME}="
                  f"{os.environ[MACOS_LIBRARY_PATH_ENV_NAME]}",
              )
          logger.debug(f"Exec'ing worker with command: {cmd}")
          # PyCharm will monkey patch the os.execvp at
          # .pycharm_helpers/pydev/_pydev_bundle/pydev_monkey.py
          # The monkey patched os.execvp function has a different
          # signature. So, we use os.execvp("executable", args=[])
          # instead of os.execvp(file="executable", args=[])
          os.execvp("bash", args=["bash", "-c", " ".join(cmd)])
  
file_path: ray/python/ray/_private/runtime_env/context.py
imports: import json
  import logging
  import os
  import subprocess
  import shlex
  import sys
  from typing import Any, Dict, List, Optional
  from ray.util.annotations import DeveloperAPI
  from ray.core.generated.common_pb2 import Language
  from ray._private.services import get_ray_jars_dir
  from ray._private.utils import update_envs
label_desc: Use image node_id 4 for calling the RuntimeEnvContext obj's underlying member method code with example usage: obj.exec_worker(passthrough_args, language) without return types