code: def poll(self):
          
          # have to wait for first load of data before we have a valid answer
          if not self.pod_reflector.first_load_future.done():
              yield self.pod_reflector.first_load_future
          data = self.pod_reflector.pods.get(self.pod_name, None)
          if data is not None:
              if data.status.phase == 'Pending':
                  return None
              ctr_stat = data.status.container_statuses
              if ctr_stat is None:  # No status, no container (we hope)
                  # This seems to happen when a pod is idle-culled.
                  return 1
              for c in ctr_stat:
                  # return exit code if notebook container has terminated
                  if c.name == 'notebook':
                      if c.state.terminated:
                          # call self.stop to delete the pod
                          if self.delete_stopped_pods:
                              yield self.stop(now=True)
                          return c.state.terminated.exit_code
                      break
              # None means pod is running or starting up
              return None
          # pod doesn't exist or has been deleted
          return 1
docs: Check if the pod is still running.
  
          Uses the same interface as subprocess.Popen.poll(): if the pod is
          still running, returns None.  If the pod has exited, return the
          exit code if we can determine it, or 1 if it has exited but we
          don't know how.  These are the return values JupyterHub expects.
  
          Note that a clean exit will have an exit code of zero, so it is
          necessary to check that the returned value is None, rather than
          just Falsy, to determine that the pod is still running.