code: def kubectl_exec_python_script(
      script_name: str,
      pod: str,
      namespace: str,
      container: Optional[str] = None,
  ) -> str:
      """
      Runs a python script in a container via `kubectl exec`.
      Scripts live in `tests/kuberay/scripts`.
  
      Prints and return kubectl's output as a string.
      """
      script_path = SCRIPTS_DIR / script_name
      with open(script_path) as script_file:
          script_string = script_file.read()
      return kubectl_exec(
          ["python", "-c", script_string], pod, namespace, container
      )
  
imports: import atexit
  import contextlib
  import logging
  import pathlib
  import subprocess
  import tempfile
  import time
  from typing import Any, Dict, Generator, List, Optional
  import yaml
  import os
  import ray
  from ray.job_submission import JobStatus, JobSubmissionClient
label_desc: Use image node_id 13 for calling a global function with example usage: kubectl_exec_python_script(script_name, pod, namespace, container) and returns: kubectl_exec