code: def test_sample_scipy():
      distribs_scipy = [
          FiniteRV(
              "F", {1: S.Half, 2: Rational(1, 4), 3: Rational(1, 4)}
          ),
          DiscreteUniform("Y", list(range(5))),
          Die("D"),
          Bernoulli("Be", 0.3),
          Binomial("Bi", 5, 0.4),
          BetaBinomial("Bb", 2, 1, 1),
          Hypergeometric("H", 1, 1, 1),
          Rademacher("R"),
      ]
  
      size = 3
      scipy = import_module("scipy")
      if not scipy:
          skip("Scipy not installed. Abort tests for _sample_scipy.")
      else:
          for X in distribs_scipy:
              samps = sample(X, size=size)
              samps2 = sample(X, size=(2, 2))
              for sam in samps:
                  assert sam in X.pspace.domain.set
              for i in range(2):
                  for j in range(2):
                      assert samps2[i][j] in X.pspace.domain.set
  
file_path: sympy/sympy/stats/sampling/tests/test_sample_finite_rv.py
imports: from sympy.core.numbers import Rational
  from sympy.core.singleton import S
  from sympy.external import import_module
  from sympy.stats import Binomial, sample, Die, FiniteRV, DiscreteUniform, Bernoulli, BetaBinomial, Hypergeometric, Rademacher
  from sympy.testing.pytest import skip, raises
label_desc: Use image node_id 3 for calling a global function with example usage: test_sample_scipy() without return types