docstr: Gives the CustomDistribution operation (product or divide) with
  the other distribution.
  
  Parameters
  ----------
  other: CustomDistribution
      The CustomDistribution to be multiplied.
  
  operation: str
      'product' for multiplication operation and 'divide' for
      division operation.
  
  inplace: boolean
      If inplace=True it will modify the factor itself, else would return
      a new distribution.
  
  Returns
  -------
  CustomDistribution or None:
                  if inplace=True (default) returns None
                  if inplace=False returns a new `CustomDistribution` instance.
docstr_tok: ["Gives","the","CustomDistribution","operation","(","product","or","divide",")","with","the","other","distribution",".","Parameters","--","--","--","--","--","other",":","CustomDistribution","The","CustomDistribution","to","be","multiplied",".","operation",":","str","'product","'","for","multiplication","operation","and","'divide","'","for","division","operation",".","inplace",":","boolean","If","inplace=True","it","will","modify","the","factor","itself",",","else","would","return","a","new","distribution",".","Returns","--","--","--","-","CustomDistribution","or","None",":","if","inplace=True","(","default",")","returns","None","if","inplace=False","returns","a","new","`","CustomDistribution","`","instance","."]
code: def _operate(self, other, operation, inplace=True):
      """
      Gives the CustomDistribution operation (product or divide) with
      the other distribution.
  
      Parameters
      ----------
      other: CustomDistribution
          The CustomDistribution to be multiplied.
  
      operation: str
          'product' for multiplication operation and 'divide' for
          division operation.
  
      inplace: boolean
          If inplace=True it will modify the factor itself, else would return
          a new distribution.
  
      Returns
      -------
      CustomDistribution or None:
                      if inplace=True (default) returns None
                      if inplace=False returns a new `CustomDistribution` instance.
  
      """
      if not isinstance(other, CustomDistribution):
          raise TypeError(
              f"CustomDistribution objects can only be multiplied or divided with another CustomDistribution object. Got {type(other)}, expected: CustomDistribution."
          )
  
      phi = self if inplace else self.copy()
      pdf = self.pdf
      self_var = [var for var in self.variables]
  
      modified_pdf_var = self_var + [
          var for var in other.variables if var not in self_var
      ]
  
      def modified_pdf(*args):
          self_pdf_args = list(args[: len(self_var)])
          other_pdf_args = [
              args[modified_pdf_var.index(var)]
              for var in other.variables
          ]
  
          if operation == "product":
              return pdf(*self_pdf_args) * other._pdf(*other_pdf_args)
          if operation == "divide":
              return pdf(*self_pdf_args) / other._pdf(*other_pdf_args)
  
      phi.variables = modified_pdf_var
      phi._pdf = modified_pdf
  
      if not inplace:
          return phi
  
imports: import numpy
  from scipy import integrate
  from pgmpy.factors.distributions import BaseDistribution
label_desc: Use image node_id 13 for calling the CustomDistribution obj's underlying member method code with example usage: obj._operate(other, operation, inplace) and returns: phi, unknown, unknown