code: def test_fra_explicit_maturity(self):
      dtype = np.float64
      notional = 1.0
      settlement_date = dates.convert_to_date_tensor([(2021, 2, 8)])
      fixing_date = dates.convert_to_date_tensor([(2021, 2, 8)])
      valuation_date = dates.convert_to_date_tensor([(2020, 2, 8)])
      fixed_rate = 0.02
      maturity_date = dates.convert_to_date_tensor([(2021, 5, 8)])
      fra = tff.experimental.instruments.ForwardRateAgreement(
          settlement_date,
          fixing_date,
          fixed_rate,
          notional=notional,
          maturity_date=maturity_date,
          dtype=dtype,
      )
  
      curve_dates = valuation_date + dates.periods.months(
          [1, 2, 3, 12, 24, 60]
      )
      reference_curve = tff.experimental.instruments.RateCurve(
          curve_dates,
          np.array(
              [0.02, 0.025, 0.0275, 0.03, 0.035, 0.0325], dtype=dtype
          ),
          valuation_date=valuation_date,
          dtype=dtype,
      )
      market = tff.experimental.instruments.InterestRateMarket(
          reference_curve=reference_curve,
          discount_curve=reference_curve,
      )
      price = self.evaluate(fra.price(valuation_date, market))
      np.testing.assert_allclose(price, 0.00377957, atol=1e-6)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/forward_rate_agreement_test.py
imports: 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 ForwardRateAgreementTest obj's underlying member method code with example usage: obj.test_fra_explicit_maturity() without return types