code: def test_reduce(self):
      phi1 = self.phi1.copy()
      phi1.reduce([("x", 1)])
  
      def reduced_pdf1(y):
          return (np.power(1, 1) * np.power(y, 2)) / beta(1, y)
  
      self.assertEqual(phi1.scope(), ["y"])
      for inp in np.random.rand(4):
          self.assertEqual(phi1.pdf(inp), reduced_pdf1(inp))
          self.assertEqual(phi1.pdf(y=inp), reduced_pdf1(inp))
  
      phi1 = self.phi1.reduce([("x", 1)], inplace=False)
      self.assertEqual(phi1.scope(), ["y"])
      for inp in np.random.rand(4):
          self.assertEqual(phi1.pdf(inp), reduced_pdf1(inp))
          self.assertEqual(phi1.pdf(y=inp), reduced_pdf1(inp))
  
      phi2 = self.phi2.copy()
      phi2.reduce([("x2", 7.213)])
  
      def reduced_pdf2(x1):
          return multivariate_normal.pdf(
              [x1, 7.213], [0, 0], [[1, 0], [0, 1]]
          )
  
      self.assertEqual(phi2.scope(), ["x1"])
      for inp in np.random.rand(4):
          self.assertEqual(phi2.pdf(inp), reduced_pdf2(inp))
          self.assertEqual(phi2.pdf(x1=inp), reduced_pdf2(inp))
  
      phi2 = self.phi2.reduce([("x2", 7.213)], inplace=False)
      self.assertEqual(phi2.scope(), ["x1"])
      for inp in np.random.rand(4):
          self.assertEqual(phi2.pdf(inp), reduced_pdf2(inp))
          self.assertEqual(phi2.pdf(x1=inp), reduced_pdf2(inp))
  
      phi3 = self.phi3.copy()
      phi3.reduce([("y", 0.112), ("z", 23)])
  
      def reduced_pdf4(x):
          return (
              23
              * (np.power(x, 1) * np.power(0.112, 2))
              / beta(x, 0.112)
          )
  
      self.assertEqual(phi3.scope(), ["x"])
      for inp in np.random.rand(4):
          self.assertEqual(phi3.pdf(inp), reduced_pdf4(inp))
          self.assertEqual(phi3.pdf(x=inp), reduced_pdf4(inp))
  
      phi3 = self.phi3.copy()
      phi3.reduce([("y", 0.112)])
  
      def reduced_pdf3(x, z):
          return (
              z * (np.power(x, 1) * np.power(0.112, 2)) / beta(x, 0.112)
          )
  
      self.assertEqual(phi3.scope(), ["x", "z"])
      for inp in np.random.rand(4, 2):
          self.assertEqual(
              phi3.pdf(inp[0], inp[1]), reduced_pdf3(inp[0], inp[1])
          )
          self.assertEqual(
              phi3.pdf(x=inp[0], z=inp[1]), reduced_pdf3(inp[0], inp[1])
          )
  
      phi3 = self.phi3.reduce([("y", 0.112)], inplace=False)
      self.assertEqual(phi3.scope(), ["x", "z"])
      for inp in np.random.rand(4, 2):
          self.assertEqual(
              phi3.pdf(inp[0], inp[1]), reduced_pdf3(inp[0], inp[1])
          )
          self.assertEqual(
              phi3.pdf(x=inp[0], z=inp[1]), reduced_pdf3(inp[0], inp[1])
          )
          self.assertEqual(
              phi3.pdf(inp[0], z=inp[1]), reduced_pdf3(inp[0], inp[1])
          )
  
      phi3 = self.phi3.reduce([("y", 0.112), ("z", 23)], inplace=False)
      self.assertEqual(phi3.scope(), ["x"])
      for inp in np.random.rand(4):
          self.assertEqual(phi3.pdf(inp), reduced_pdf4(inp))
          self.assertEqual(phi3.pdf(x=inp), reduced_pdf4(inp))
  
imports: import unittest
  import numpy
  import numpy.testing
  from scipy.special import beta
  from scipy.stats import multivariate_normal
  from pgmpy.factors.continuous import ContinuousFactor
label_desc: Use image node_id 8 for calling the TestContinuousFactorMethods obj's underlying member method code with example usage: obj.test_reduce() and returns: unknown, multivariate_normal, unknown, unknown