class_docstr: Tests for methods for the american pricing module.
docstr: Tests Bjerksund Stensland 2002 prices for negative cost of carries.
docstr_tok: ["Tests","Bjerksund","Stensland","2002","prices","for","negative","cost","of","carries","."]
code: def test_bs2002_prices_with_dividends(
      self,
      discount_rates,
      dividend_rates,
      volatilities,
      expiries,
      expected_prices,
  ):
      """Tests Bjerksund Stensland 2002 prices for negative 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 = np.array([True] * 5 + [False] * 5)
      computed_prices = bjerksund_stensland(
          volatilities=volatilities,
          strikes=strikes,
          expiries=expiries,
          discount_rates=discount_rates,
          dividend_rates=dividend_rates,
          spots=spots,
          is_call_options=is_call_options,
          modified_boundary=True,
          dtype=tf.float64,
      )
      expected_prices = np.array(expected_prices)
      with self.subTest(name="ExpectedPrices"):
          msg = "Failed: Bjerksund Stensland 2002 with dividends test."
          self.assertAllClose(
              expected_prices,
              computed_prices,
              rtol=5e-3,
              atol=5e-3,
              msg=msg,
          )
  
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 12 for calling the AmericanPrice obj's underlying member method code with example usage: obj.test_bs2002_prices_with_dividends(discount_rates, dividend_rates, volatilities, expiries, expected_prices) without return types