class_docstr: Provide a custom function to check if trial should be stopped.
  
  The passed function will be called after each iteration. If it returns
  True, the trial will be stopped.
  
  Args:
      function: Function that checks if a trial
          should be stopped. Must accept the `trial_id` string  and `result`
          dictionary as arguments. Must return a boolean.
code: def __init__(self, function: Callable[[str, Dict], bool]):
      self._fn = function
  
file_path: ray/python/ray/tune/stopper/function_stopper.py
imports: from typing import Dict, Callable
  from ray.util.annotations import PublicAPI
  from ray.tune.stopper.stopper import Stopper
label_desc: Use image node_id 1 to create a new FunctionStopper object from inherited base classes: Stopper with example: obj = FunctionStopper(function)