code: def test_copulas_distr(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)
  
      marginals = [uniform] * k_dim
      cad = CopulaDistribution(ca, marginals, cop_args=args)
      # TODO: check also for specific archimedean classes
      # cad = CopulaDistribution(cop(k_dim=k_dim), marginals, cop_args=args)
      cdfd = cad.cdf(np.array(u), cop_args=args)
      assert_allclose(cdfd, cdf1, rtol=1e-13)
      assert cdfd.shape == ()
  
      # check pdf
      pdfd = cad.pdf(np.array(u), cop_args=args)
      assert_allclose(pdfd, pdf1, rtol=1e-13)
      assert cdfd.shape == ()
  
      # using list u
      cdfd = cad.cdf(u, cop_args=args)
      assert_allclose(cdfd, cdf1, rtol=1e-13)
      assert cdfd.shape == ()
  
      assert_allclose(cdf1, cdf2, rtol=1e-13)
      assert_allclose(pdf1, pdf2, rtol=1e-13)
  
      # check vector values for u
      cdfd = cad.cdf(np.array(u) * np.ones((3, 1)), cop_args=args)
      assert_allclose(cdfd, cdf2, rtol=1e-13)
      assert cdfd.shape == (3,)
  
      # check mv, check at marginal cdf
      with warnings.catch_warnings():
          warnings.simplefilter("ignore", FutureWarning)
  
          cdfmv = ca.cdf(list(u) + [1], args=args)
      assert_allclose(cdfmv, cdf1, rtol=1e-13)
      assert cdfd.shape == (3,)
  
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 6 for calling a global function with example usage: test_copulas_distr(case) without return types