code: def test_sample_numpy():
      distribs_numpy = [
          Binomial("B", 5, 0.4),
          Hypergeometric("H", 2, 1, 1),
      ]
      size = 3
      numpy = import_module("numpy")
      if not numpy:
          skip("Numpy is not installed. Abort tests for _sample_numpy.")
      else:
          for X in distribs_numpy:
              samps = sample(X, size=size, library="numpy")
              for sam in samps:
                  assert sam in X.pspace.domain.set
          raises(
              NotImplementedError,
              lambda: sample(Die("D"), library="numpy"),
          )
      raises(
          NotImplementedError,
          lambda: Die("D").pspace.sample(library="tensorflow"),
      )
  
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 2 for calling a global function with example usage: test_sample_numpy() without return types