code: def kubectl_logs(
      pod: str,
      namespace: str,
      container: Optional[str] = None,
  ) -> str:
      """Wrapper for kubectl logs.
  
      Returns the logs as a string.
      """
      container_option = ["-c", container] if container else []
      kubectl_logs_command = ["kubectl", "logs", pod] + container_option
      out = (
          subprocess.check_output(kubectl_logs_command).decode().strip()
      )
      return out
  
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 12 for calling a global function with example usage: kubectl_logs(pod, namespace, container) and returns: out