code: def test_sampling(self):
      np.random.seed(1010101)
      samples = self.nuts_sampler.sample(
          initial_pos=[-0.4, 1, 3.6],
          num_adapt=0,
          num_samples=10000,
          return_type="recarray",
      )
      sample_array = np.array(
          [samples[var_name] for var_name in self.test_model.variables]
      )
      sample_covariance = np.cov(sample_array)
      self.assertTrue(
          np.linalg.norm(sample_covariance - self.test_model.covariance)
          < 3
      )
  
      np.random.seed(1210161)
      samples = self.nuts_sampler.generate_sample(
          initial_pos=[-0.4, 1, 3.6], num_adapt=0, num_samples=10000
      )
      samples_array = np.array([sample for sample in samples])
      sample_covariance = np.cov(samples_array.T)
      self.assertTrue(
          np.linalg.norm(sample_covariance - self.test_model.covariance)
          < 3
      )
  
      np.random.seed(12313131)
      samples = self.nuts_sampler.sample(
          initial_pos=[0.2, 0.4, 2.2],
          num_adapt=10000,
          num_samples=10000,
      )
      sample_covariance = np.cov(samples.values.T)
      self.assertTrue(
          np.linalg.norm(sample_covariance - self.test_model.covariance)
          < 0.4
      )
  
      np.random.seed(921312312)
      samples = self.nuts_sampler.generate_sample(
          initial_pos=[0.2, 0.4, 2.2],
          num_adapt=10000,
          num_samples=30000,
      )
      samples_array = np.array([sample for sample in samples])
      sample_covariance = np.cov(samples_array.T)
      self.assertTrue(
          np.linalg.norm(sample_covariance - self.test_model.covariance)
          < 0.4
      )
  
imports: import sys
  import unittest
  import numpy
  from pgmpy.factors.distributions import GaussianDistribution
  from pgmpy.sampling import HamiltonianMC, HamiltonianMCDA, GradLogPDFGaussian, NoUTurnSampler, NoUTurnSamplerDA
label_desc: Use image node_id 3 for calling the TestNUTSInference obj's underlying member method code with example usage: obj.test_sampling() without return types