code: def setUp(self):
      self.instant_forward_rate = lambda *args: [0.01]
  
      # See D. Brigo, F. Mercurio. Interest Rate Models. 2007.
      def _true_std_time_dep(t, intervals, vol, k):
          res = np.zeros_like(t, dtype=np.float64)
          for i, tt in enumerate(t):
              var = 0.0
              for j in range(len(intervals) - 1):
                  if tt >= intervals[j] and tt < intervals[j + 1]:
                      var = var + vol[j] ** 2 / 2 / k * (
                          np.exp(2 * k * tt)
                          - np.exp(2 * k * intervals[j])
                      )
                      break
                  else:
                      var = var + vol[j] ** 2 / 2 / k * (
                          np.exp(2 * k * intervals[j + 1])
                          - np.exp(2 * k * intervals[j])
                      )
              else:
                  var = var + vol[-1] ** 2 / 2 / k * (
                      np.exp(2 * k * tt) - np.exp(2 * k * intervals[-1])
                  )
              res[i] = np.exp(-k * tt) * np.sqrt(var)
  
          return res
  
      self.true_std_time_dep = _true_std_time_dep
  
      def _true_zcb_std(t, tau, v, k):
          e_tau = np.exp(-k * tau)
          et = np.exp(k * t)
          val = (
              v
              / k
              * (1.0 - e_tau * et)
              * np.sqrt((1.0 - 1.0 / et / et) / k / 2)
          )
          return val
  
      self.true_zcb_std = _true_zcb_std
  
      super(GaussianHJMModelTest, self).setUp()
  
file_path: tf-quant-finance/tf_quant_finance/models/hjm/gaussian_hjm_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 1 for calling the GaussianHJMModelTest obj's underlying member method code with example usage: obj.setUp() and returns: res, val