class_docstr: Unit tests for metropolis sampling 
docstr: Tests metropolis sampling from Normal distribution 
docstr_tok: ["Tests","metropolis","sampling","from","Normal","distribution"]
code: def test_metropolis_normal(self):
      """Tests metropolis sampling from Normal distribution"""
      self.report("Test metropolis sampling from Normal Distribution.")
      mean = 11
      var = 3
      dist = Normal(mean, var)
      samples = dist.draw_samples(
          "metropolis", self.size, np.array([11])
      )
      mean_r = self._compute_mean(samples)
      var_r = self._compute_variance(samples)
      self._check_sample_sizes(samples)
      assert abs(mean - mean_r) <= self.threshold
      assert abs(var - var_r) <= self.threshold
      self.report(
          "%s :: test result: mean=%0.3f, variance=%0.3f"
          % (str(dist), mean_r, var_r),
          "test_result",
      )
  
file_path: dragonfly/dragonfly/distributions/unittest_metropolis.py
imports: from __future__ import absolute_import
  import unittest
  import numpy
  from .continuous import Normal, Exponential, ContinuousUniform
  from ..utils.base_test_class import BaseTestClass, execute_tests
label_desc: Use image node_id 5 for calling the MetropolisTestCases obj's underlying member method code with example usage: obj.test_metropolis_normal() without return types