code: def past_stop_threshold(stop_threshold, eval_metric):
      """Return a boolean representing whether a model should be stopped.
  
      Args:
        stop_threshold: float, the threshold above which a model should stop
          training.
        eval_metric: float, the current value of the relevant metric to check.
  
      Returns:
        True if training should stop, False otherwise.
  
      Raises:
        ValueError: if either stop_threshold or eval_metric is not a number
      """
      if stop_threshold is None:
          return False
  
      if not isinstance(stop_threshold, numbers.Number):
          raise ValueError(
              "Threshold for checking stop conditions must be a number."
          )
      if not isinstance(eval_metric, numbers.Number):
          raise ValueError(
              "Eval metric being checked against stop conditions "
              "must be a number."
          )
  
      if eval_metric >= stop_threshold:
          tf.compat.v1.logging.info(
              "Stop threshold of {} was passed with metric value {}.".format(
                  stop_threshold, eval_metric
              )
          )
          return True
  
      return False
  
file_path: autodist/examples/benchmark/utils/misc/model_helpers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numbers
  import tensorflow
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: past_stop_threshold(stop_threshold, eval_metric) and returns: False, False, True