class_docstr: TrialContext is the system-provided API to a Trial class.
class_docstr_tok: ["TrialContext","is","the","system-provided","API","to","a","Trial","class","."]
docstr: Set a flag to request a trial stoppage. When this flag is set to True,
  we finish the step, checkpoint, then exit.
docstr_tok: ["Set","a","flag","to","request","a","trial","stoppage",".","When","this","flag","is","set","to","True",",","we","finish","the","step",",","checkpoint",",","then","exit","."]
code: def set_stop_requested(self, stop_requested: bool) -> None:
      """
      Set a flag to request a trial stoppage. When this flag is set to True,
      we finish the step, checkpoint, then exit.
      """
      if not isinstance(stop_requested, bool):
          raise AssertionError("stop_requested must be a boolean")
  
      logger.info(
          "A trial stoppage has requested. The trial will be stopped "
          "at the end of the current step."
      )
      self._stop_requested = stop_requested
  
file_path: determined/harness/determined/_trial_context.py
imports: import logging
  import pathlib
  from typing import Any, Dict
  import determined
  from determined import core
label_desc: Use image node_id 11 for calling the TrialContext obj's underlying member method code with example usage: obj.set_stop_requested(stop_requested) without return types