code: def test_andersen_lake_european(
      self,
      k,
      tau,
      r,
      q,
      is_call_options,
      sigma,
      s,
      grid_num_points,
      integration_num_points_kronrod,
      integration_num_points_legendre,
      tolerance_exercise_boundary,
      tolerance_kronrod,
      max_iterations_exercise_boundary,
      max_depth_kronrod,
      dtype=tf.float64,
  ):
      # When r == q == 0 American option prices are the same as European.
      expected = option_price(
          volatilities=sigma,
          strikes=k,
          expiries=tau,
          spots=s,
          discount_rates=r,
          dividend_rates=q,
          is_call_options=is_call_options,
          dtype=dtype,
      )
      expected_prices = np.array(self.evaluate(expected))
      computed_prices = andersen_lake(
          volatilities=sigma,
          strikes=k,
          expiries=tau,
          spots=s,
          discount_rates=r,
          dividend_rates=q,
          is_call_options=is_call_options,
          grid_num_points=grid_num_points,
          integration_num_points_kronrod=integration_num_points_kronrod,
          integration_num_points_legendre=integration_num_points_legendre,
          max_iterations_exercise_boundary=max_iterations_exercise_boundary,
          max_depth_kronrod=max_depth_kronrod,
          tolerance_exercise_boundary=tolerance_exercise_boundary,
          tolerance_kronrod=tolerance_kronrod,
          dtype=dtype,
      )
      computed_prices = np.array(self.evaluate(computed_prices))
      np.testing.assert_allclose(
          computed_prices, expected_prices, rtol=1e-8
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/american_option_pricing/andersen_lake_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the ExerciseBoundaryTest obj's underlying member method code with example usage: obj.test_andersen_lake_european(k, tau, r, q, is_call_options, sigma, s, grid_num_points, integration_num_points_kronrod, integration_num_points_legendre, tolerance_exercise_boundary, tolerance_kronrod, max_iterations_exercise_boundary, max_depth_kronrod, dtype) without return types