code: def _(dist: SingleFiniteDistribution, size, seed):
      # scipy can handle with custom distributions
  
      from scipy.stats import rv_discrete
  
      density_ = dist.dict
      x, y = [], []
      for k, v in density_.items():
          x.append(int(k))
          y.append(float(v))
      scipy_rv = rv_discrete(name="scipy_rv", values=(x, y))
      return scipy_rv.rvs(size=size, random_state=seed)
  
imports: from functools import singledispatch
  from sympy.core.symbol import Dummy
  from sympy.functions.elementary.exponential import exp
  from sympy.utilities.lambdify import lambdify
  from sympy.external import import_module
  from sympy.stats import DiscreteDistributionHandmade
  from sympy.stats.crv import SingleContinuousDistribution
  from sympy.stats.crv_types import ChiSquaredDistribution, ExponentialDistribution, GammaDistribution, LogNormalDistribution, NormalDistribution, ParetoDistribution, UniformDistribution, BetaDistribution, StudentTDistribution, CauchyDistribution
  from sympy.stats.drv_types import GeometricDistribution, LogarithmicDistribution, NegativeBinomialDistribution, PoissonDistribution, SkellamDistribution, YuleSimonDistribution, ZetaDistribution
  from sympy.stats.frv import SingleFiniteDistribution
label_desc: Use image node_id 21 for calling a global function with example usage: _(dist, size, seed) and returns: scipy_rv