code: def _is_non_decreasing(fn, q, bounds):
      """Verifies whether the function is non-decreasing within a range.
  
      Args:
        fn: Symbolic function of a single variable.
        q: The name of f's variable.
        bounds: Pair of (lower_bound, upper_bound) reals.
  
      Returns:
        True iff the function is non-decreasing in the range.
      """
      diff_fn = sp.diff(fn, q)  # Symbolically compute the derivative.
      diff_fn_lambdified = sp.lambdify(
          q,
          diff_fn,
          modules=[
              "numpy",
              {
                  "erfc": scipy.special.erfc,
                  "erfcinv": scipy.special.erfcinv,
              },
          ],
      )
      r = scipy.optimize.minimize_scalar(
          diff_fn_lambdified, bounds=bounds, method="bounded"
      )
      assert r.success, "Minimizer failed to converge."
      return r.fun >= 0
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl import app
  import numpy
  import scipy
  import sympy
  import core
label_desc: Use image node_id 19 for calling a global function with example usage: _is_non_decreasing(fn, q, bounds) and returns: unknown