code: def test_cap_correctness(self, dtype):
      notional = 100.0
  
      period3m = dates.periods.months(3)
  
      cap = instruments.CapAndFloor(
          self.start_date,
          self.maturity_date,
          period3m,
          0.005,
          daycount_convention=instruments.DayCountConvention.ACTUAL_365,
          notional=notional,
          dtype=dtype,
      )
  
      price = self.evaluate(
          cap.price(
              self.valuation_date,
              self.get_market(),
              model=instruments.InterestRateModelType.LOGNORMAL_RATE,
              pricing_context=0.5,
          )
      )
      np_testing.assert_allclose(price, 1.0474063612452953, atol=1e-6)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/cap_floor_test.py
imports: from absl.testing import parameterized
  import numpy
  from numpy import testing
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 3 for calling the CapFloorTest obj's underlying member method code with example usage: obj.test_cap_correctness(dtype) without return types