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","."]
code: def __init__(self) -> None:
      # mock is the main Session Mock
      self.mock_session = mock.MagicMock()
      self.mock_session.get.side_effect = self.session_get
      self._state = False
      self._cond = threading.Condition()
  
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 1 to create a new MockPreemptState object  with example: obj = MockPreemptState()