class_docstr: Tests for methods for the american pricing module.
docstr: Tests the Baron-Adesi Whaley prices for positive cost_of_carries.
docstr_tok: ["Tests","the","Baron-Adesi","Whaley","prices","for","positive","cost_of_carries","."]
code: def test_option_prices_pos_carries(
      self,
      discount_rates,
      dividends,
      volatilities,
      expiries,
      expected_prices,
  ):
      """Tests the Baron-Adesi Whaley prices for positive cost_of_carries."""
      spots = np.array([80.0, 90.0, 100.0, 110.0, 120.0] * 2)
      strikes = np.array([100.0] * 10)
      is_call_options = [True] * 5 + [False] * 5
      computed_prices, converged, failed = adesi_whaley(
          volatilities=volatilities,
          strikes=strikes,
          expiries=expiries,
          discount_rates=discount_rates,
          dividend_rates=dividends,
          spots=spots,
          is_call_options=is_call_options,
          dtype=tf.float64,
      )
      with self.subTest(name="ExpectedPrices"):
          self.assertAllClose(
              expected_prices, computed_prices, rtol=5e-3, atol=5e-3
          )
      with self.subTest(name="AllConverged"):
          self.assertAllEqual(converged, tf.ones_like(computed_prices))
      with self.subTest(name="NonFailed"):
          self.assertAllEqual(failed, tf.zeros_like(computed_prices))
  
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 AmericanPrice obj's underlying member method code with example usage: obj.test_option_prices_pos_carries(discount_rates, dividends, volatilities, expiries, expected_prices) without return types