code: def test_bond_stub_begin(self, dtype):
      settlement_date = dates.convert_to_date_tensor([(2020, 1, 1)])
      maturity_date = dates.convert_to_date_tensor([(2021, 2, 1)])
      first_coupon_date = dates.convert_to_date_tensor([(2020, 2, 1)])
      valuation_date = dates.convert_to_date_tensor([(2020, 1, 1)])
      period_6m = dates.periods.months(6)
      fix_spec = instruments.FixedCouponSpecs(
          coupon_frequency=period_6m,
          currency="usd",
          notional=100.0,
          coupon_rate=0.06,
          daycount_convention=instruments.DayCountConvention.ACTUAL_365,
          businessday_rule=dates.BusinessDayConvention.NONE,
      )
  
      bond_inst = instruments.Bond(
          settlement_date,
          maturity_date,
          [fix_spec],
          first_coupon_date=first_coupon_date,
          dtype=dtype,
      )
  
      curve_dates = valuation_date + dates.periods.months(
          [0, 6, 12, 24]
      )
      reference_curve = instruments.RateCurve(
          curve_dates,
          np.array([0.0, 0.025, 0.03, 0.035], dtype=dtype),
          valuation_date=valuation_date,
          dtype=dtype,
      )
      market = instruments.InterestRateMarket(
          discount_curve=reference_curve
      )
  
      price = self.evaluate(bond_inst.price(valuation_date, market))
      np.testing.assert_allclose(price, [103.12756228], atol=1e-6)
  
      expected_coupon_dates = dates.convert_to_date_tensor(
          [(2020, 2, 1), (2020, 8, 1), (2021, 2, 1)]
      )
      self.assertAllEqual(
          expected_coupon_dates.ordinal(),
          bond_inst._cashflows.payment_dates.ordinal(),
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/bond_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 3 for calling the BondTest obj's underlying member method code with example usage: obj.test_bond_stub_begin(dtype) without return types