code: def test_nhypergeom_pmf():
      # test with hypergeom
      M, n, r = 45, 13, 8
      k = 6
      NHG = nhypergeom.pmf(k, M, n, r)
      HG = (
          hypergeom.pmf(k, M, n, k + r - 1)
          * (M - n - (r - 1))
          / (M - (k + r - 1))
      )
      assert_allclose(HG, NHG, rtol=1e-10)
  
imports: import pytest
  from scipy.stats import betabinom, hypergeom, nhypergeom, bernoulli, boltzmann, skellam, zipf, zipfian, binom, nbinom, nchypergeom_fisher, nchypergeom_wallenius, randint
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal, assert_allclose
  from scipy.special import binom
  import pytest
  from scipy.optimize import root_scalar
  from scipy.integrate import quad
label_desc: Use image node_id 2 for calling a global function with example usage: test_nhypergeom_pmf() without return types