code: def testFindsOneRoot(self):
      self._testFindsAllRoots(
          objective_fn=lambda x: 4 * x**2 - 4,
          left_bracket=[1],  # Root
          right_bracket=[0],
          expected_roots=[1],
          expected_num_iterations=[0],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: x**3 - 4 * x**2 + 3,
          left_bracket=[-1],
          right_bracket=[1],  # Root
          expected_roots=[1],
          expected_num_iterations=[0],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: x**2 - 7,
          left_bracket=[2],
          right_bracket=[3],
          expected_roots=[2.6457513093775136],
          expected_num_iterations=[4],
      )
  
      self._testFindsAllRoots(
          objective_fn=polynomial5,
          left_bracket=[-1],
          right_bracket=[1],
          expected_roots=[-0.14823253013216148],
          expected_num_iterations=[6],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: exp(x) - 2 * x**2,
          left_bracket=[1],
          right_bracket=[2],
          expected_roots=[1.487962064137658],
          expected_num_iterations=[4],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: exp(-x) - 2 * x**2,
          left_bracket=[0],
          right_bracket=[1],
          expected_roots=[0.5398352897010781],
          expected_num_iterations=[5],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: x * (1 - cos(x)),
          left_bracket=[-1],
          right_bracket=[1],
          expected_roots=[0.0],
          expected_num_iterations=[1],
      )
  
      self._testFindsAllRoots(
          objective_fn=lambda x: 1 - x + sin(x),
          left_bracket=[1],
          right_bracket=[2],
          expected_roots=[1.934563210652628],
          expected_num_iterations=[4],
      )
  
      self._testFindsAllRoots(
          # Flat in the [-0.5, 0.5] range.
          objective_fn=lambda x: 0 if x == 0 else x * exp(-1 / x**2),
          left_bracket=[-10],
          right_bracket=[1],
          expected_roots=[-0.017029902449646958],
          expected_num_iterations=[22],
          # Set the tolerance to zero to match the SciPy implementation.
          function_tolerance=0,
      )
  
imports: import math
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math.root_search import utils
label_desc: Use image node_id 2 for calling the BrentqTest obj's underlying member method code with example usage: obj.testFindsOneRoot() without return types