code: def test_operate(self):
      phi1 = self.phi1.copy()
      phi1._operate(self.phi2, "product")
      self.assertEqual(phi1.scope(), ["x", "y", "x1", "x2"])
      for inp in np.random.rand(4, 4):
          self.assertEqual(
              phi1.pdf(*inp),
              self.phi1.pdf(inp[0], inp[1])
              * self.phi2.pdf(inp[2], inp[3]),
          )
  
      phi1 = self.phi1._operate(self.phi2, "product", inplace=False)
      self.assertEqual(phi1.scope(), ["x", "y", "x1", "x2"])
      for inp in np.random.rand(4, 4):
          self.assertEqual(
              phi1.pdf(*inp),
              self.phi1.pdf(inp[0], inp[1])
              * self.phi2.pdf(inp[2], inp[3]),
          )
  
      phi1 = self.phi1 * self.phi2
      self.assertEqual(phi1.scope(), ["x", "y", "x1", "x2"])
      for inp in np.random.rand(4, 4):
          self.assertEqual(
              phi1.pdf(*inp),
              self.phi1.pdf(inp[0], inp[1])
              * self.phi2.pdf(inp[2], inp[3]),
          )
  
      phi3 = self.phi3.copy()
      phi3._operate(self.phi1, "product")
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) * self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi3 = self.phi3._operate(self.phi1, "product", inplace=False)
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) * self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi3 = self.phi3 * self.phi1
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) * self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi3 = self.phi3.copy()
      phi3._operate(self.phi1, "divide")
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) / self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi3 = self.phi3._operate(self.phi1, "divide", inplace=False)
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) / self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi3 = self.phi3 / self.phi1
      self.assertEqual(phi3.scope(), ["x", "y", "z"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi3.pdf(*inp),
              self.phi3.pdf(*inp) / self.phi1.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4.copy()
      phi4._operate(self.phi2, "product")
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) * self.phi2.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4._operate(self.phi2, "product", inplace=False)
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) * self.phi2.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4 * self.phi2
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) * self.phi2.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4.copy()
      phi4._operate(self.phi2, "divide")
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) / self.phi2.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4._operate(self.phi2, "divide", inplace=False)
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) / self.phi2.pdf(inp[0], inp[1]),
          )
  
      phi4 = self.phi4 / self.phi2
      self.assertEqual(phi4.scope(), ["x1", "x2", "x3"])
      for inp in np.random.rand(4, 3):
          self.assertEqual(
              phi4.pdf(*inp),
              self.phi4.pdf(*inp) / self.phi2.pdf(inp[0], inp[1]),
          )
  
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 13 for calling the TestContinuousFactorMethods obj's underlying member method code with example usage: obj.test_operate() without return types