docs: def outliers_tietjen(x, k, hypo = False, alpha = 0.05):
  
      """
      Tietjen-Moore test [1]_ to detect multiple outliers in a univariate
      data set that follows an approximately normal distribution.
      The Tietjen-Moore test [2]_ is a generalization of the Grubbs' test to
      the case of multiple outliers. If testing for a single outlier,
      the Tietjen-Moore test is equivalent to the Grubbs' test.
  
      The null hypothesis implies that there are no outliers in the data set.
  
      Parameters
      ----------
      x : array_like or ndarray, 1d
          An array, any object exposing the array interface, containing
          data to test for an outlier in.
  
      k : int
          Number of potential outliers to test for. Function tests for
          outliers in both tails.
  
      hypo : bool, optional
          Specifies whether to return a bool value of a hypothesis test result.
          Returns True when we can reject the null hypothesis. Otherwise, False.
          Available options are:
          1) True - return a hypothesis test result
          2) False - return a filtered array without outliers (default)
  
      alpha : float, optional
          Significance level for a hypothesis test. Default is 0.05.
  
      Returns
      -------
      Numpy array if hypo is False or a bool value of a hypothesis test result.
  
      Notes
      -----
      .. [1] Tietjen and Moore (August 1972), Some Grubbs-Type Statistics
          for the Detection of Outliers, Technometrics, 14(3), pp. 583-597.
      .. [2] http://www.itl.nist.gov/div898/handbook/eda/section3/eda35h2.htm
  
      Examples
      --------
      >>> x = np.array([-1.40, -0.44, -0.30, -0.24, -0.22, -0.13, -0.05, 0.06,
      0.10, 0.18, 0.20, 0.39, 0.48, 0.63, 1.01])
      >>> outliers_tietjen(x, 2)
      array([-0.44, -0.3 , -0.24, -0.22, -0.13, -0.05,  0.06,  0.1 ,  0.18,
      0.2 ,  0.39,  0.48,  0.63])
  
      """
  
      n = x.size
      def tietjen(x_, k_):
          x_mean = x_.mean()
          r = np.abs(x_ - x_mean)
          z = x_[r.argsort()]
          E = np.sum((z[:-k_] - z[:-k_].mean()) ** 2) / np.sum((z - x_mean) ** 2)
          return E
  
      E_x = tietjen(x, k)
      E_norm = np.zeros(10000)
  
      for i in np.arange(10000):
          norm = np.random.normal(size=n)
          E_norm[i] = tietjen(norm, k)
  
      CV = np.percentile(E_norm, alpha * 100)
      result = E_x < CV
  
      if hypo:
          return result
      else:
          if result:
              ind = np.argpartition(np.abs(x - x.mean()), -k)[-k:]
              return np.delete(x, ind)
          else:
              return x