class_docstr: Base class for factors representing various multivariate
  representations.
docstr: Parameters
  ----------
  variables: list or array-like
      The variables for which the distribution is defined.
  
  pdf: function
      The probability density function of the distribution.
  
  Examples
  --------
  >>> import numpy as np
  >>> from scipy.special import beta
  >>> from pgmpy.factors.continuous import ContinuousFactor
  # Two variable dirichlet distribution with alpha = (1,2)
  >>> def dirichlet_pdf(x, y):
  ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
  >>> dirichlet_factor = ContinuousFactor(['x', 'y'], dirichlet_pdf)
  >>> dirichlet_factor.scope()
  ['x', 'y']
  >>> dirichlet_factor.assignment(5,6)
  226800.0
docstr_tok: ["Parameters","--","--","--","--","--","variables",":","list","or","array-like","The","variables","for","which","the","distribution","is","defined",".","pdf",":","function","The","probability","density","function","of","the","distribution",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","scipy.special","import","beta",">",">",">","from","pgmpy.factors.continuous","import","ContinuousFactor","#","Two","variable","dirichlet","distribution","with","alpha","=","(","1,2",")",">",">",">","def","dirichlet_pdf","(","x",",","y",")",":","...","return","(","np.power","(","x",",","1",")","*","np.power","(","y",",","2",")",")","\/","beta","(","x",",","y",")",">",">",">","dirichlet_factor","=","ContinuousFactor","(","[","'","x","'",",","'","y","'","]",",","dirichlet_pdf",")",">",">",">","dirichlet_factor.scope","(",")","[","'","x","'",",","'","y","'","]",">",">",">","dirichlet_factor.assignment","(","5,6",")","226800.0"]
code: def __init__(self, variables, pdf, *args, **kwargs):
      """
      Parameters
      ----------
      variables: list or array-like
          The variables for which the distribution is defined.
  
      pdf: function
          The probability density function of the distribution.
  
      Examples
      --------
      >>> import numpy as np
      >>> from scipy.special import beta
      >>> from pgmpy.factors.continuous import ContinuousFactor
      # Two variable dirichlet distribution with alpha = (1,2)
      >>> def dirichlet_pdf(x, y):
      ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
      >>> dirichlet_factor = ContinuousFactor(['x', 'y'], dirichlet_pdf)
      >>> dirichlet_factor.scope()
      ['x', 'y']
      >>> dirichlet_factor.assignment(5,6)
      226800.0
      """
      if not isinstance(variables, (list, tuple, np.ndarray)):
          raise TypeError(
              f"variables: Expected type list or array-like, got type {type(variables)}"
          )
  
      if len(set(variables)) != len(variables):
          raise ValueError("Variable names cannot be same.")
  
      variables = list(variables)
  
      if isinstance(pdf, str):
          if pdf == "gaussian":
              self.distribution = GaussianDistribution(
                  variables=variables,
                  mean=kwargs["mean"],
                  covariance=kwargs["covariance"],
              )
          else:
              raise NotImplementedError(
                  f"{pdf} distribution not supported. Please use CustomDistribution"
              )
  
      elif isinstance(pdf, CustomDistribution):
          self.distribution = pdf
  
      elif callable(pdf):
          self.distribution = CustomDistribution(
              variables=variables, distribution=pdf
          )
  
      else:
          raise ValueError(
              f"pdf: Expected type: str or function, Got: {type(variables)}"
          )
  
imports: import types
  import numpy
  import scipy.integrate
  from pgmpy.factors.base import BaseFactor
  from pgmpy.factors.distributions import GaussianDistribution, CustomDistribution
label_desc: Use image node_id 1 to create a new ContinuousFactor object from inherited base classes: BaseFactor with example: obj = ContinuousFactor(variables, pdf)