class_docstr: Returns the sample from pymc of the given distribution
class_docstr_tok: ["Returns","the","sample","from","pymc","of","the","given","distribution"]
docstr: Sample from PyMC.
code: def _sample_pymc(cls, dist, size, seed):
      """Sample from PyMC."""
  
      try:
          import pymc
      except ImportError:
          import pymc3 as pymc
      pymc_rv_map = {
          "MatrixNormalDistribution": lambda dist: pymc.MatrixNormal(
              "X",
              mu=matrix2numpy(dist.location_matrix, float),
              rowcov=matrix2numpy(dist.scale_matrix_1, float),
              colcov=matrix2numpy(dist.scale_matrix_2, float),
              shape=dist.location_matrix.shape,
          ),
          "WishartDistribution": lambda dist: pymc.WishartBartlett(
              "X",
              nu=int(dist.n),
              S=matrix2numpy(dist.scale_matrix, float),
          ),
      }
  
      sample_shape = {
          "WishartDistribution": lambda dist: dist.scale_matrix.shape,
          "MatrixNormalDistribution": lambda dist: dist.location_matrix.shape,
      }
  
      dist_list = pymc_rv_map.keys()
  
      if dist.__class__.__name__ not in dist_list:
          return None
      import logging
  
      logging.getLogger("pymc").setLevel(logging.ERROR)
      with pymc.Model():
          pymc_rv_map[dist.__class__.__name__](dist)
          samps = pymc.sample(
              draws=prod(size),
              chains=1,
              progressbar=False,
              random_seed=seed,
              return_inferencedata=False,
              compute_convergence_checks=False,
          )["X"]
      return samps.reshape(
          size + sample_shape[dist.__class__.__name__](dist)
      )
  
imports: from math import prod
  from sympy.core.basic import Basic
  from sympy.core.numbers import pi
  from sympy.core.singleton import S
  from sympy.functions.elementary.exponential import exp
  from sympy.functions.special.gamma_functions import multigamma
  from sympy.core.sympify import sympify, _sympify
  from sympy.matrices import ImmutableMatrix, Inverse, Trace, Determinant, MatrixSymbol, MatrixBase, Transpose, MatrixSet, matrix2numpy
  from sympy.stats.rv import _value_check, RandomMatrixSymbol, NamedArgsMixin, PSpace, _symbol_converter, MatrixDomain, Distribution
  from sympy.external import import_module
label_desc: Use image node_id 2 for calling the SampleMatrixPymc obj's underlying member method code with example usage: obj._sample_pymc(cls, dist, size, seed) and returns: samps, None