code: def ttest_ind(
      x1,
      x2,
      alternative="two-sided",
      usevar="pooled",
      weights=(None, None),
      value=0,
  ):
      """ttest independent sample
  
      Convenience function that uses the classes and throws away the intermediate
      results,
      compared to scipy stats: drops axis option, adds alternative, usevar, and
      weights option.
  
      Parameters
      ----------
      x1 : array_like, 1-D or 2-D
          first of the two independent samples, see notes for 2-D case
      x2 : array_like, 1-D or 2-D
          second of the two independent samples, see notes for 2-D case
      alternative : str
          The alternative hypothesis, H1, has to be one of the following
  
             * 'two-sided' (default): H1: difference in means not equal to value
             * 'larger' :   H1: difference in means larger than value
             * 'smaller' :  H1: difference in means smaller than value
  
      usevar : str, 'pooled' or 'unequal'
          If ``pooled``, then the standard deviation of the samples is assumed to be
          the same. If ``unequal``, then Welch ttest with Satterthwait degrees
          of freedom is used
      weights : tuple of None or ndarrays
          Case weights for the two samples. For details on weights see
          ``DescrStatsW``
      value : float
          difference between the means under the Null hypothesis.
  
  
      Returns
      -------
      tstat : float
          test statistic
      pvalue : float
          pvalue of the t-test
      df : int or float
          degrees of freedom used in the t-test
  
      """
      cm = CompareMeans(
          DescrStatsW(x1, weights=weights[0], ddof=0),
          DescrStatsW(x2, weights=weights[1], ddof=0),
      )
      tstat, pval, dof = cm.ttest_ind(
          alternative=alternative, usevar=usevar, value=value
      )
  
      return tstat, pval, dof
  
imports: import numpy
  from scipy import stats
  from statsmodels.tools.decorators import cache_readonly
label_desc: Use image node_id 6 for calling a global function with example usage: ttest_ind(x1, x2, alternative, usevar, weights, value) and returns: tstat,  pval,  dof