code: def test_construct_vol_covar_and_no_vol(self):
      # Check the None, None
      dtype = np.float64
      covar_matrix = np.array([[0.15, 0.30], [0.30, 0.60]]).astype(
          dtype
      )
  
      def covar_fn(t1, t2):
          return bm_utils.outer_multiply(t2 - t1, covar_matrix)
  
      vol_fn, covar_fn = bm_utils.construct_vol_data(
          None, covar_fn, 2, dtype
      )
  
      times = tf.constant([0.5, 1.0, 2.0, 3.0], dtype=dtype)
      vols = self.evaluate(vol_fn(times))
      np.testing.assert_array_equal(vols.shape, [4, 2, 2])
      # Directly testing vols is not sensible because given a covariance matrix
      # there are many volatility matrices that would lead to the same covar.
      # So we instead check the implied covariance.
      for i in range(4):
          actual_covar = np.matmul(vols[i], vols[i].transpose())
          np.testing.assert_allclose(actual_covar, covar_matrix)
      times2 = times + 0.31415
      # Check that the total covariance is correct.
      tc = self.evaluate(covar_fn(times, times2))
      np.testing.assert_array_equal(tc.shape, [4, 2, 2])
      # Directly testing vols is not sensible because given a covariance matrix
      # there are many volatility matrices that would lead to the same covar.
      # So we instead check the implied covariance.
      for i in range(4):
          np.testing.assert_allclose(tc[i], covar_matrix * 0.31415)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import test_util
  from tf_quant_finance.models.legacy import brownian_motion_utils
label_desc: Use image node_id 7 for calling the BrownianMotionUtilsTest obj's underlying member method code with example usage: obj.test_construct_vol_covar_and_no_vol() and returns: bm_utils