code: def test_null_distribution():
      # Create a mixed population of Z-scores: 1000 standard normal and
      # 20 uniformly distributed between 3 and 4.
      grid = np.linspace(0.001, 0.999, 1000)
      z0 = norm.ppf(grid)
      z1 = np.linspace(3, 4, 20)
      zs = np.concatenate((z0, z1))
      emp_null = NullDistribution(zs, estimate_null_proportion=True)
  
      assert_allclose(emp_null.mean, 0, atol=1e-5, rtol=1e-5)
      assert_allclose(emp_null.sd, 1, atol=1e-5, rtol=1e-2)
      assert_allclose(
          emp_null.null_proportion, 0.98, atol=1e-5, rtol=1e-2
      )
  
      # consistency check
      assert_allclose(
          emp_null.pdf(np.r_[-1, 0, 1]),
          norm.pdf(
              np.r_[-1, 0, 1], loc=emp_null.mean, scale=emp_null.sd
          ),
          rtol=1e-13,
      )
  
imports: import pytest
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal, assert_allclose
  from statsmodels.stats.multitest import multipletests, fdrcorrection, fdrcorrection_twostage, NullDistribution, local_fdr, multitest_methods_names
  from statsmodels.stats.multicomp import tukeyhsd
  from scipy.stats.distributions import norm
  import scipy
  from packaging import version
label_desc: Use image node_id 9 for calling a global function with example usage: test_null_distribution() without return types