code: def test_sample_scipy():
      p = S(2) / 3
      x = Symbol("x", integer=True, positive=True)
      pdf = p * (1 - p) ** (x - 1)  # pdf of Geometric Distribution
      distribs_scipy = [
          DiscreteRV(x, pdf, set=S.Naturals),
          Geometric("G", 0.5),
          Logarithmic("L", 0.5),
          NegativeBinomial("N", 5, 0.4),
          Poisson("P", 1),
          Skellam("S", 1, 1),
          YuleSimon("Y", 1),
          Zeta("Z", 2),
      ]
      size = 3
      scipy = import_module("scipy")
      if not scipy:
          skip("Scipy is not installed. Abort tests for _sample_scipy.")
      else:
          for X in distribs_scipy:
              samps = sample(X, size=size, library="scipy")
              samps2 = sample(X, size=(2, 2), library="scipy")
              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_discrete_rv.py
imports: from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.external import import_module
  from sympy.stats import Geometric, Poisson, Zeta, sample, Skellam, DiscreteRV, Logarithmic, NegativeBinomial, YuleSimon
  from sympy.testing.pytest import skip, raises, slow
label_desc: Use image node_id 2 for calling a global function with example usage: test_sample_scipy() without return types