code: def test_swap_constructor(self, past_fixing, expecter_res):
      fixed_coupon = rate_instruments.coupon_specs.FixedCouponSpecs(
          currency=currencies.Currency.USD,
          coupon_frequency=tff.datetime.periods.months(3),
          notional_amount=10000,
          fixed_rate=0.03,
          daycount_convention=daycount_conventions.DayCountConventions.ACTUAL_360,
          businessday_rule=business_days.BusinessDayConvention.FOLLOWING,
          settlement_days=2,
          calendar=business_days.BankHolidays.US,
      )
      float_coupon = rate_instruments.coupon_specs.FloatCouponSpecs(
          currency=currencies.Currency.USD,
          coupon_frequency=tff.datetime.periods.months(3),
          reset_frequency=tff.datetime.periods.months(3),
          notional_amount=10000,
          floating_rate_type=framework.core.rate_indices.RateIndex(
              type="LIBOR_3M"
          ),
          daycount_convention=daycount_conventions.DayCountConventions.ACTUAL_360,
          businessday_rule=business_days.BusinessDayConvention.FOLLOWING,
          settlement_days=2,
          spread=0.0,
          calendar=business_days.BankHolidays.US,
      )
      schedule = tff.datetime.PeriodicSchedule(
          start_date=tff.datetime.dates_from_tensor([2019, 1, 1]),
          end_date=tff.datetime.dates_from_tensor([2021, 1, 1]),
          tenor=tff.datetime.periods.months(3),
      ).dates()
      swap = interest_rate_swap.InterestRateSwap(
          pay_leg=fixed_coupon,
          receive_leg=float_coupon,
          pay_leg_schedule=schedule,
          receive_leg_schedule=schedule,
          config=interest_rate_swap.InterestRateSwapConfig(
              past_fixing=past_fixing
          ),
      )
      market = market_data.MarketDataDict(self._market_data_dict)
      price = swap.price(market)
      self.assertAllClose(price, expecter_res, rtol=1e-4, atol=1e-4)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/interest_rate_swap/interest_rate_swap_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 7 for calling the InterestRateSwapTest obj's underlying member method code with example usage: obj.test_swap_constructor(past_fixing, expecter_res) without return types