code: def test_yields_from_pv_grouped(self, dtype):
      # 2 and 3 year bonds with 1000 face value and 4%, 6% semi-annual coupons.
      cashflows = np.array(
          [20, 20, 20, 1020, 30, 30, 30, 30, 30, 1030], dtype=dtype
      )
      times = np.array(
          [0.5, 1, 1.5, 2, 0.5, 1, 1.50, 2, 2.5, 3], dtype=dtype
      )
      groups = np.array([0] * 4 + [1] * 6)
      pvs = np.array([942.71187528177757, 1025.7777300221542])
      expected_yield_rates = [0.07, 0.05]
      actual_yield_rates = self.evaluate(
          tff.rates.analytics.cashflows.yields_from_pv(
              cashflows, times, pvs, groups=groups, dtype=dtype
          )
      )
      np.testing.assert_allclose(
          expected_yield_rates, actual_yield_rates, atol=1e-7
      )
  
file_path: tf-quant-finance/tf_quant_finance/rates/analytics/cashflows_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 6 for calling the CashflowsTest obj's underlying member method code with example usage: obj.test_yields_from_pv_grouped(dtype) without return types