class_docstr: ``PreemptContext`` gives access to preemption signals that originate from a user action, such as
  pausing an experiment using the WebUI or the CLI, from in the Determined scheduler.
class_docstr_tok: ["``","PreemptContext","``","gives","access","to","preemption","signals","that","originate","from","a","user","action",",","such","as","pausing","an","experiment","using","the","WebUI","or","the","CLI",",","from","in","the","Determined","scheduler","."]
docstr: ``acknowledge_preemption_signal()`` tells the Determined master that you are shutting down,
  but you have not finished your work and you expect to be restarted later to complete it.
  
  This is important to tell the master explicitly because otherwise if the python process
  exits with a zero exit code, the master interprets that as a completed task, and the task
  does not get rescheduled.
  
  By default, ``acknowledge_preemption_signal()`` is called automatically the first time that
  ``should_preempt()`` returns ``True``, unless ``should_preempt()`` is called with
  ``auto_ack=False``.
docstr_tok: ["``","acknowledge_preemption_signal","(",")","``","tells","the","Determined","master","that","you","are","shutting","down",",","but","you","have","not","finished","your","work","and","you","expect","to","be","restarted","later","to","complete","it",".","This","is","important","to","tell","the","master","explicitly","because","otherwise","if","the","python","process","exits","with","a","zero","exit","code",",","the","master","interprets","that","as","a","completed","task",",","and","the","task","does","not","get","rescheduled",".","By","default",",","``","acknowledge_preemption_signal","(",")","``","is","called","automatically","the","first","time","that","``","should_preempt","(",")","``","returns","``","True","``",",","unless","``","should_preempt","(",")","``","is","called","with","``","auto_ack=False","``","."]
code: def acknowledge_preemption_signal(self) -> None:
      """
      ``acknowledge_preemption_signal()`` tells the Determined master that you are shutting down,
      but you have not finished your work and you expect to be restarted later to complete it.
  
      This is important to tell the master explicitly because otherwise if the python process
      exits with a zero exit code, the master interprets that as a completed task, and the task
      does not get rescheduled.
  
      By default, ``acknowledge_preemption_signal()`` is called automatically the first time that
      ``should_preempt()`` returns ``True``, unless ``should_preempt()`` is called with
      ``auto_ack=False``.
      """
      logger.debug("acknowledge_preemption_signal()")
      self._session.post(
          f"/api/v1/allocations/{self._allocation_id}/signals/ack_preemption"
      )
  
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 7 for calling the PreemptContext obj's underlying member method code with example usage: obj.acknowledge_preemption_signal() without return types