code: def kubectl_patch(
      kind: str,
      name: str,
      namespace: str,
      patch: Dict[str, Any],
      patch_type: str = "strategic",
  ):
      """Wrapper for kubectl patch.
  
      Args:
          kind: Kind of the K8s resource (e.g. pod)
          name: Name of the K8s resource.
          namespace: Namespace of the K8s resource.
          patch: The patch to apply, as a dict.
          patch_type: json, merge, or strategic
      """
      with tempfile.NamedTemporaryFile("w") as patch_file:
          yaml.dump(patch, patch_file)
          patch_file.flush()
          subprocess.check_call(
              [
                  "kubectl",
                  "-n",
                  f"{namespace}",
                  "patch",
                  f"{kind}",
                  f"{name}",
                  "--patch-file",
                  f"{patch_file.name}",
                  "--type",
                  f"{patch_type}",
              ]
          )
  
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 19 for calling a global function with example usage: kubectl_patch(kind, name, namespace, patch, patch_type) without return types