class_docstr: MockPreemptState uses threading to simulate the behavior of the long-
  polling requests call.
class_docstr_tok: ["MockPreemptState","uses","threading","to","simulate","the","behavior","of","the","long-","polling","requests","call","."]
docstr: preempt() is called from the test code.
docstr_tok: ["preempt","(",")","is","called","from","the","test","code","."]
code: def preempt(self) -> None:
      """preempt() is called from the test code."""
      with self._cond:
          self._state = True
          self._cond.notify()
  
file_path: determined/harness/tests/core/test_preempt.py
imports: import threading
  import time
  from typing import Any, Dict, Tuple
  from unittest import mock
  import pytest
  from determined import core
  from tests import parallel
label_desc: Use image node_id 2 for calling the MockPreemptState obj's underlying member method code with example usage: obj.preempt() without return types