code: def test_skewnorm():
      # library("sn")
      # dsn(c(-2,-1,0,1,2), shape=10)
      # psn(c(-2,-1,0,1,2), shape=10)
      # noquote(sprintf("%.15e,", snp))
      pdf_r = np.array(
          [
              2.973416551551523e-90,
              3.687562713971017e-24,
              3.989422804014327e-01,
              4.839414490382867e-01,
              1.079819330263761e-01,
          ]
      )
      pdf_sn = skewnorm.pdf([-2, -1, 0, 1, 2], 10)
  
      # res = (snp-snp_r)/snp
      assert_(np.allclose(pdf_sn, pdf_r, rtol=1e-13, atol=0))
  
      pdf_sn2 = skewnorm2.pdf([-2, -1, 0, 1, 2], 10)
      assert_(np.allclose(pdf_sn2, pdf_r, rtol=1e-13, atol=0))
  
      cdf_r = np.array(
          [
              0.000000000000000e00,
              0.000000000000000e00,
              3.172551743055357e-02,
              6.826894921370859e-01,
              9.544997361036416e-01,
          ]
      )
      cdf_sn = skewnorm.cdf([-2, -1, 0, 1, 2], 10)
      maxabs = np.max(np.abs(cdf_sn - cdf_r))
      maxrel = np.max(np.abs(cdf_sn - cdf_r) / (cdf_r + 1e-50))
      msg = "maxabs={:15.13g}, maxrel={:15.13g}\n{!r}\n{!r}".format(
          maxabs, maxrel, cdf_sn, cdf_r
      )
      # assert_(np.allclose(cdf_sn, cdf_r, rtol=1e-13, atol=1e-25), msg=msg)
      assert_almost_equal(cdf_sn, cdf_r, decimal=10)
  
      cdf_sn2 = skewnorm2.cdf([-2, -1, 0, 1, 2], 10)
      maxabs = np.max(np.abs(cdf_sn2 - cdf_r))
      maxrel = np.max(np.abs(cdf_sn2 - cdf_r) / (cdf_r + 1e-50))
      msg = "maxabs={:15.13g}, maxrel={:15.13g}".format(maxabs, maxrel)
      # assert_(np.allclose(cdf_sn2, cdf_r, rtol=1e-13, atol=1e-25), msg=msg)
      assert_almost_equal(cdf_sn2, cdf_r, decimal=10, err_msg=msg)
  
imports: import numpy
  from numpy.testing import assert_, assert_almost_equal
  from statsmodels.sandbox.distributions.extras import skewnorm, skewnorm2, ACSkewT_gen
label_desc: Use image node_id 1 for calling a global function with example usage: test_skewnorm() without return types