code: def test_null_constrained(
      estimate_mean, estimate_scale, estimate_prob
  ):
      # 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_mean=estimate_mean,
          estimate_scale=estimate_scale,
          estimate_null_proportion=estimate_prob,
      )
  
      if not estimate_mean:
          assert_allclose(emp_null.mean, 0, atol=1e-5, rtol=1e-5)
      if not estimate_scale:
          assert_allclose(emp_null.sd, 1, atol=1e-5, rtol=1e-2)
      if not estimate_prob:
          assert_allclose(
              emp_null.null_proportion, 1, 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 10 for calling a global function with example usage: test_null_constrained(estimate_mean, estimate_scale, estimate_prob) without return types