code: def test_copulas(case):
      # check ev copulas, cdf and transform against R `copula` package
      cop_tr, u, args, cdf2, pdf2, cop = case
      k_dim = np.asarray(u).shape[-1]
      ca = ArchimedeanCopula(cop_tr(), k_dim=k_dim)
      cdf1 = ca.cdf(u, args=args)
      pdf1 = ca.pdf(u, args=args)
      assert_allclose(cdf1, cdf2, rtol=1e-13)
      assert_allclose(pdf1, pdf2, rtol=1e-13)
      assert cdf1.shape == ()
  
      logpdf1 = ca.logpdf(u, args=args)
      assert_allclose(logpdf1, np.log(pdf2), rtol=1e-13)
  
      # compare with specific copula class
      ca2 = cop(k_dim=k_dim)
      cdf3 = ca2.cdf(u, args=args)
      pdf3 = ca2.pdf(u, args=args)
      logpdf3 = ca2.logpdf(u, args=args)
      assert_allclose(cdf3, cdf2, rtol=1e-13)
      assert_allclose(pdf3, pdf2, rtol=1e-13)
      assert_allclose(logpdf3, np.log(pdf2), rtol=1e-13)
      assert cdf3.shape == ()
      assert pdf3.shape == ()
  
imports: import warnings
  from statsmodels.compat.pytest import pytest_warns
  from statsmodels.compat.scipy import SP_LT_15
  import numpy
  from numpy.testing import assert_allclose, assert_array_almost_equal
  import pytest
  from scipy import stats
  from statsmodels.distributions.copula.archimedean import ArchimedeanCopula, ClaytonCopula, FrankCopula, GumbelCopula, _debyem1_expansion
  from statsmodels.distributions.copula.copulas import CopulaDistribution
  import statsmodels.distributions.copula.depfunc_ev
  from statsmodels.distributions.copula.elliptical import GaussianCopula, StudentTCopula
  from statsmodels.distributions.copula.extreme_value import ExtremeValueCopula, copula_bv_ev
  from statsmodels.distributions.copula.other_copulas import IndependenceCopula
  import statsmodels.distributions.copula.transforms
  from statsmodels.distributions.tools import approx_copula_pdf, frequencies_fromdata
  from statsmodels.tools.numdiff import approx_fprime_cs, approx_hess
label_desc: Use image node_id 4 for calling a global function with example usage: test_copulas(case) without return types