code: def _should_stop(state, stopping_policy_fn):
      """Indicates whether the overall Brent search should continue.
  
      Args:
        state: A Python `_BrentSearchState` namedtuple.
        stopping_policy_fn: Python `callable` controlling the algorithm termination.
  
      Returns:
        A boolean value indicating whether the overall search should continue.
      """
      return tf.convert_to_tensor(
          stopping_policy_fn(state.finished),
          name="should_stop",
          dtype=tf.bool,
      )
  
file_path: tf-quant-finance/tf_quant_finance/math/root_search/brent.py
imports: from typing import Callable
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math.root_search import utils
label_desc: Use image node_id 4 for calling a global function with example usage: _should_stop(state, stopping_policy_fn) and returns: tf