code: def test_copy(self):
      copy_phi1 = self.phi1.copy()
      self.assertEqual(copy_phi1.variables, self.phi1.variables)
      np_test.assert_array_equal(copy_phi1.K, self.phi1.K)
      np_test.assert_array_equal(copy_phi1.h, self.phi1.h)
      np_test.assert_array_equal(copy_phi1.g, self.phi1.g)
  
      copy_phi1.marginalize(["x1"])
      self.assertEqual(self.phi1.variables, ["x1", "x2", "x3"])
      np_test.assert_array_equal(
          self.phi1.K,
          np.array(
              [[1.1, -1, 0], [-1, 4, -2], [0, -2, 4]], dtype=float
          ),
      )
      np_test.assert_array_equal(
          self.phi1.h, np.array([[1], [4.7], [-1]], dtype=float)
      )
      self.assertEqual(self.phi1.g, -2)
  
      self.phi1.marginalize(["x2"])
      self.assertEqual(copy_phi1.variables, ["x2", "x3"])
      np_test.assert_almost_equal(
          copy_phi1.K, np.array([[3.090909, -2.0], [-2.0, 4.0]])
      )
      np_test.assert_almost_equal(
          copy_phi1.h, np.array([[5.6090909], [-1.0]])
      )
      np_test.assert_almost_equal(copy_phi1.g, -0.5787165566)
  
      self.phi1 = self.phi3
  
file_path: pgmpy/pgmpy/tests/test_factors/test_continuous/test_Canonical_Factor.py
imports: import unittest
  import numpy
  import numpy.testing
  from pgmpy.factors.distributions import GaussianDistribution
  from pgmpy.factors.continuous import CanonicalDistribution
label_desc: Use image node_id 7 for calling the TestJGDMethods obj's underlying member method code with example usage: obj.test_copy() without return types