code: def upload_worker_process_setup_hook_if_needed(
      runtime_env: Union[Dict[str, Any], RuntimeEnv],
      worker: "ray.Worker",
  ) -> Union[Dict[str, Any], RuntimeEnv]:
      """Uploads the worker_process_setup_hook to GCS with a key.
  
      runtime_env["worker_process_setup_hook"] is converted to a decoded key
      that can load the worker setup hook function from GCS.
      i.e., you can use internalKV.Get(runtime_env["worker_process_setup_hook])
      to access the worker setup hook from GCS.
  
      Args:
          runtime_env: The runtime_env. The value will be modified
              when returned.
          worker: ray.worker instance.
          decoder: GCS requires the function key to be bytes. However,
              we cannot json serialize (which is required to serialize
              runtime env) the bytes. So the key should be decoded to
              a string. The given decoder is used to decode the function
              key.
      """
      setup_func = runtime_env.get("worker_process_setup_hook")
  
      if setup_func is None:
          return runtime_env
  
      if isinstance(setup_func, Callable):
          return export_setup_func_callable(
              runtime_env, setup_func, worker
          )
      elif isinstance(setup_func, str):
          return export_setup_func_module(runtime_env, setup_func)
      else:
          raise TypeError(
              "worker_process_setup_hook must be a function, "
              f"got {type(setup_func)}."
          )
  
file_path: ray/python/ray/_private/runtime_env/setup_hook.py
imports: import traceback
  import logging
  import base64
  import os
  from typing import Dict, Any, Callable, Union, Optional
  import ray
  import ray._private.ray_constants
  from ray._private.storage import _load_class
  import ray.cloudpickle
  from ray.runtime_env import RuntimeEnv
label_desc: Use image node_id 6 for calling a global function with example usage: upload_worker_process_setup_hook_if_needed(runtime_env, worker) and returns: runtime_env, export_setup_func_callable, export_setup_func_module