code: def test_ttest():
      x1, x2 = clinic[:15, 2], clinic[15:, 2]
      all_tests = []
      t1 = smws.ttest_ind(
          x1, x2, alternative="larger", usevar="unequal"
      )
      all_tests.append((t1, ttest_clinic_indep_1_g))
      t2 = smws.ttest_ind(
          x1, x2, alternative="smaller", usevar="unequal"
      )
      all_tests.append((t2, ttest_clinic_indep_1_l))
      t3 = smws.ttest_ind(
          x1, x2, alternative="smaller", usevar="unequal", value=1
      )
      all_tests.append((t3, ttest_clinic_indep_1_l_mu))
  
      for res1, res2 in all_tests:
          assert_almost_equal(res1[0], res2.statistic, decimal=13)
          assert_almost_equal(res1[1], res2.p_value, decimal=13)
          # assert_almost_equal(res1[2], res2.df, decimal=13)
  
      cm = smws.CompareMeans(smws.DescrStatsW(x1), smws.DescrStatsW(x2))
      ci = cm.tconfint_diff(alternative="two-sided", usevar="unequal")
      assert_almost_equal(
          ci, ttest_clinic_indep_1_two_mu.conf_int, decimal=13
      )
      ci = cm.tconfint_diff(alternative="two-sided", usevar="pooled")
      assert_almost_equal(
          ci, ttest_clinic_indep_1_two_mu_pooled.conf_int, decimal=13
      )
      ci = cm.tconfint_diff(alternative="smaller", usevar="unequal")
      assert_almost_equal_inf(
          ci, ttest_clinic_indep_1_l.conf_int, decimal=13
      )
      ci = cm.tconfint_diff(alternative="larger", usevar="unequal")
      assert_almost_equal_inf(
          ci, ttest_clinic_indep_1_g.conf_int, decimal=13
      )
  
      # test get_compare
      cm = smws.CompareMeans(smws.DescrStatsW(x1), smws.DescrStatsW(x2))
      cm1 = cm.d1.get_compare(cm.d2)
      cm2 = cm.d1.get_compare(x2)
      cm3 = cm.d1.get_compare(np.hstack((x2, x2)))
      # all use the same d1, no copying
      assert_(cm.d1 is cm1.d1)
      assert_(cm.d1 is cm2.d1)
      assert_(cm.d1 is cm3.d1)
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_equal, assert_
  import pytest
  import statsmodels.stats.weightstats
  from statsmodels.tools.testing import Holder
label_desc: Use image node_id 4 for calling a global function with example usage: test_ttest() without return types