code: def rv(symbol, cls, args):
      args = list(map(sympify, args))
      dist = cls(*args)
      dist.check(*args)
      dim = dist.dimension
      pspace = MatrixPSpace(symbol, dist, dim[0], dim[1])
      return pspace.value
  
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 1 for calling a global function with example usage: rv(symbol, cls, args) and returns: pspace