code: def k8s_managed_cluster() -> Iterator[ManagedK8sCluster]:
      cluster = ManagedK8sCluster()
      cluster._scale_master(up=True)
      yield cluster
      cluster._scale_master(up=True)
  
      print(
          "Master logs: ",
          det_cmd(["master", "logs"], check=True).stdout.decode(
              "utf-8"
          ),
      )
  
file_path: determined/e2e_tests/tests/cluster/managed_cluster_k8s.py
imports: import time
  from typing import Iterator
  import pytest
  from kubernetes import client, config, watch
  from tests import config
  from .abstract_cluster import Cluster
  from .managed_cluster import get_agent_data
  from .test_groups import det_cmd
  from .utils import run_command, wait_for_command_state
label_desc: Use image node_id 1 for calling a global function with example usage: k8s_managed_cluster() without return types