code: def test_betanbinom_pmf(self, x, n, a, b, ref):
      # test that PMF stays accurate in the distribution tails
      # reference values computed with mpmath
      # from mpmath import mp
      # mp.dps = 500
      # def betanbinom_pmf(k, n, a, b):
      #     k = mp.mpf(k)
      #     a = mp.mpf(a)
      #     b = mp.mpf(b)
      #     n = mp.mpf(n)
      #     return float(mp.binomial(n + k - mp.one, k)
      #                  * mp.beta(a + n, b + k) / mp.beta(a, b))
      assert_allclose(betanbinom.pmf(x, n, a, b), ref, rtol=1e-10)
  
imports: import pytest
  import itertools
  from scipy.stats import betabinom, betanbinom, 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, suppress_warnings
  from scipy.special import binom
  from scipy.optimize import root_scalar
  from scipy.integrate import quad
label_desc: Use image node_id 1 for calling the TestBetaNBinom obj's underlying member method code with example usage: obj.test_betanbinom_pmf(x, n, a, b, ref) without return types