code: def ttost_ind(
      x1,
      x2,
      low,
      upp,
      usevar="pooled",
      weights=(None, None),
      transform=None,
  ):
      """test of (non-)equivalence for two independent samples
  
      TOST: two one-sided t tests
  
      null hypothesis:  m1 - m2 < low or m1 - m2 > upp
      alternative hypothesis:  low < m1 - m2 < upp
  
      where m1, m2 are the means, expected values of the two samples.
  
      If the pvalue is smaller than a threshold, say 0.05, then we reject the
      hypothesis that the difference between the two samples is larger than the
      the thresholds given by low and upp.
  
      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
      low, upp : float
          equivalence interval low < m1 - m2 < upp
      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``
      transform : None or function
          If None (default), then the data is not transformed. Given a function,
          sample data and thresholds are transformed. If transform is log, then
          the equivalence interval is in ratio: low < m1 / m2 < upp
  
      Returns
      -------
      pvalue : float
          pvalue of the non-equivalence test
      t1, pv1 : tuple of floats
          test statistic and pvalue for lower threshold test
      t2, pv2 : tuple of floats
          test statistic and pvalue for upper threshold test
  
      Notes
      -----
      The test rejects if the 2*alpha confidence interval for the difference
      is contained in the ``(low, upp)`` interval.
  
      This test works also for multi-endpoint comparisons: If d1 and d2
      have the same number of columns, then each column of the data in d1 is
      compared with the corresponding column in d2. This is the same as
      comparing each of the corresponding columns separately. Currently no
      multi-comparison correction is used. The raw p-values reported here can
      be correction with the functions in ``multitest``.
  
      """
  
      if transform:
          if transform is np.log:
              # avoid hstack in special case
              x1 = transform(x1)
              x2 = transform(x2)
          else:
              # for transforms like rankdata that will need both datasets
              # concatenate works for stacking 1d and 2d arrays
              xx = transform(np.concatenate((x1, x2), 0))
              x1 = xx[: len(x1)]
              x2 = xx[len(x1) :]
          low = transform(low)
          upp = transform(upp)
      cm = CompareMeans(
          DescrStatsW(x1, weights=weights[0], ddof=0),
          DescrStatsW(x2, weights=weights[1], ddof=0),
      )
      pval, res = cm.ttost_ind(low, upp, usevar=usevar)
      return pval, res[0], res[1]
  
imports: import numpy
  from scipy import stats
  from statsmodels.tools.decorators import cache_readonly
label_desc: Use image node_id 7 for calling a global function with example usage: ttost_ind(x1, x2, low, upp, usevar, weights, transform) and returns: pval,  res,  res