class_docstr: DummyPreemptContext is a PreemptContext where should_preempt() always returns False.
class_docstr_tok: ["DummyPreemptContext","is","a","PreemptContext","where","should_preempt","(",")","always","returns","False","."]
code: def should_preempt(self, auto_ack: bool = True) -> bool:
      if not self._started:
          # Match the requirements of the real PreemptContext class.
          raise RuntimeError(
              "you cannot call PreemptContext.should_preempt() before PreemptContext.start()"
          )
      if self._dist.rank == 0:
          if self._preempt_mode == PreemptMode.WorkersAskChief:
              # Even though we always return False, preserve the synchronization behavior to avoid
              # giving the user a weird inconsistency between managed and unmanaged dtrain code.
              _ = self._dist.broadcast(False)
      else:
          if self._preempt_mode == PreemptMode.ChiefOnly:
              raise RuntimeError(
                  "PreemptContext was configured with preempt_mode=ChiefOnly but "
                  ".should_preempt() was called from non-chief worker of "
                  f"rank={self._dist.get_rank()}"
              )
          if self._preempt_mode == PreemptMode.WorkersAskChief:
              _ = self._dist.broadcast(None)
      return False
  
imports: import enum
  import logging
  import threading
  import time
  from typing import Any, Optional
  import requests
  from determined import core
  from determined.common import api
label_desc: Use image node_id 6 for calling the DummyPreemptContext obj's underlying member method code with example usage: obj.should_preempt(auto_ack) and returns: False