code: def print_logs(self):
      while True:
          time.sleep(10)
          # Try to tail the pod logs
          try:
              for line in self.corev1_api.read_namespaced_pod_log(
                  self.test_name,
                  self.namespace,
                  follow=True,
                  _preload_content=False,
              ):
                  print(line.decode("utf-8"), flush=True, end="")
              # above call blocks for pod lifetime, so we may need to refresh tokens
              self.refresh_config()
  
          except client.rest.ApiException as e:
              print(
                  "Got exception: {} while reading pod logs".format(e)
              )
              pass
  
          try:
              pod = self.corev1_api.read_namespaced_pod(
                  self.test_name, self.namespace
              )
          except client.rest.ApiException as e:
              print("Got exception: {} while reading pod".format(e))
              continue
  
          if not hasattr(pod, "status") or not pod.status:
              continue
          if (
              not hasattr(pod.status, "container_statuses")
              or not pod.status.container_statuses
          ):
              continue
  
          for container_status in pod.status.container_statuses:
              if container_status.state.waiting is not None:
                  if (
                      container_status.state.waiting.reason == "Error"
                      or container_status.state.waiting.reason
                      == "CrashLoopBackOff"
                      or container_status.state.waiting.reason
                      == "ImagePullBackOff"
                      or container_status.state.waiting.reason
                      == "ErrImagePull"
                  ):
                      return
              if container_status.state.terminated is not None:
                  return
  
file_path: coach/rl_coach/tests/test_eks.py
imports: import argparse
  import pytest
  import time
  from kubernetes import client, config
label_desc: Use image node_id 5 for calling the EKSHandler obj's underlying member method code with example usage: obj.print_logs() without return types