code: def test_deriv():
      # Check link function derivatives using numeric differentiation.
  
      np.random.seed(24235)
  
      for link in Links:
          for k in range(10):
              p = np.random.uniform(0, 1)
              if isinstance(link, links.Cauchy):
                  p = np.clip(p, 0.03, 0.97)
              d = link.deriv(p)
              da = nd.approx_fprime(np.r_[p], link)
              assert_allclose(
                  d, da, rtol=1e-6, atol=1e-6, err_msg=str(link)
              )
              if not isinstance(
                  link,
                  (
                      type(inverse_power),
                      type(inverse_squared),
                      type(logc),
                  ),
              ):
                  # check monotonically increasing
                  assert_array_less(-d, 0)
  
file_path: statsmodels/statsmodels/genmod/families/tests/test_link.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_equal, assert_array_less
  from scipy import stats
  import pytest
  import statsmodels.genmod.families
  from statsmodels.tools import numdiff
label_desc: Use image node_id 3 for calling a global function with example usage: test_deriv() without return types