code: def is_done(self):
      # Check if the container is done. As a side effect, also refreshes self._job and
      # self._pod with the latest state
      def done():
          # Either the container succeeds or fails naturally or else we may have
          # forced the pod termination causing the job to still be in an
          # active state but for all intents and purposes dead to us.
          return (
              bool(self._job["status"].get("succeeded"))
              or bool(self._job["status"].get("failed"))
              or self._are_pod_containers_done
              or (self._job["spec"]["parallelism"] == 0)
          )
  
      if not done():
          # If not done, fetch newer status
          self._job = self._fetch_job()
          self._pod = self._fetch_pod()
      return done()
  
imports: import json
  import math
  import random
  import time
  from metaflow.tracing import inject_tracing_vars
  from metaflow.exception import MetaflowException
  from metaflow.metaflow_config import KUBERNETES_SECRETS
label_desc: Use image node_id 7 for calling the RunningJob obj's underlying member method code with example usage: obj.is_done() and returns: done, unknown