class_docstr: A temporary Probability Space for the Compound Distribution. After
  Marginalization, this returns the corresponding Probability Space of the
  parent distribution.
docstr: This function returns the new pspace of the distribution using handmade
  Distributions and their corresponding pspace.
docstr_tok: ["This","function","returns","the","new","pspace","of","the","distribution","using","handmade","Distributions","and","their","corresponding","pspace","."]
code: def _transform_pspace(self, sym, dist, pdf):
      """
      This function returns the new pspace of the distribution using handmade
      Distributions and their corresponding pspace.
      """
      pdf = Lambda(sym, pdf(sym))
      _set = dist.set
      if isinstance(dist, ContinuousDistribution):
          return SingleContinuousPSpace(
              sym, ContinuousDistributionHandmade(pdf, _set)
          )
      elif isinstance(dist, DiscreteDistribution):
          return SingleDiscretePSpace(
              sym, DiscreteDistributionHandmade(pdf, _set)
          )
      elif isinstance(dist, SingleFiniteDistribution):
          dens = {k: pdf(k) for k in _set}
          return SingleFinitePSpace(
              sym, FiniteDistributionHandmade(dens)
          )
  
imports: from sympy.concrete.summations import Sum
  from sympy.core.basic import Basic
  from sympy.core.function import Lambda
  from sympy.core.symbol import Dummy
  from sympy.integrals.integrals import Integral
  from sympy.stats.rv import NamedArgsMixin, random_symbols, _symbol_converter, PSpace, RandomSymbol, is_random, Distribution
  from sympy.stats.crv import ContinuousDistribution, SingleContinuousPSpace
  from sympy.stats.drv import DiscreteDistribution, SingleDiscretePSpace
  from sympy.stats.frv import SingleFiniteDistribution, SingleFinitePSpace
  from sympy.stats.crv_types import ContinuousDistributionHandmade
  from sympy.stats.drv_types import DiscreteDistributionHandmade
  from sympy.stats.frv_types import FiniteDistributionHandmade
label_desc: Use image node_id 12 for calling the CompoundPSpace obj's underlying member method code with example usage: obj._transform_pspace(sym, dist, pdf) and returns: SingleContinuousPSpace, SingleDiscretePSpace, SingleFinitePSpace