docs: def __convert_to_df(a, val_col=None, group_col=None, val_id=None, group_id=None):
  
      '''Hidden helper method to create a DataFrame with input data for further
      processing.
  
      Parameters
      ----------
      a : array_like or pandas DataFrame object
          An array, any object exposing the array interface or a pandas DataFrame.
          Array must be two-dimensional. Second dimension may vary,
          i.e. groups may have different lengths.
  
      val_col : str, optional
          Name of a DataFrame column that contains dependent variable values (test
          or response variable). Values should have a non-nominal scale. Must be
          specified if `a` is a pandas DataFrame object.
  
      group_col : str, optional
          Name of a DataFrame column that contains independent variable values
          (grouping or predictor variable). Values should have a nominal scale
          (categorical). Must be specified if `a` is a pandas DataFrame object.
  
      val_id : int, optional
          Index of a column that contains dependent variable values (test or
          response variable). Should be specified if a NumPy ndarray is used as an
          input. It will be inferred from data, if not specified.
  
      group_id : int, optional
          Index of a column that contains independent variable values (grouping or
          predictor variable). Should be specified if a NumPy ndarray is used as
          an input. It will be inferred from data, if not specified.
  
      Returns
      -------
      x : pandas DataFrame
          DataFrame with input data, `val_col` column contains numerical values and
          `group_col` column contains categorical values.
  
      val_col : str
          Name of a DataFrame column that contains dependent variable values (test
          or response variable).
  
      group_col : str
          Name of a DataFrame column that contains independent variable values
          (grouping or predictor variable).
  
      Notes
      -----
      Inferrence algorithm for determining `val_id` and `group_id` args is rather
      simple, so it is better to specify them explicitly to prevent errors.
  
      '''
  
      if not group_col:
          group_col = 'groups'
      if not val_col:
          val_col = 'vals'
  
      if isinstance(a, DataFrame):
          x = a.copy()
          if not {group_col, val_col}.issubset(a.columns):
              raise ValueError('Specify correct column names using `group_col` and `val_col` args')
          return x, val_col, group_col
  
      elif isinstance(a, list) or (isinstance(a, np.ndarray) and not a.shape.count(2)):
          grps_len = map(len, a)
          grps = list(it.chain(*[[i+1] * l for i, l in enumerate(grps_len)]))
          vals = list(it.chain(*a))
  
          return DataFrame({val_col: vals, group_col: grps}), val_col, group_col
  
      elif isinstance(a, np.ndarray):
  
          # cols ids not defined
          # trying to infer
          if not(all([val_id, group_id])):
  
              if np.argmax(a.shape):
                  a = a.T
  
              ax = [np.unique(a[:, 0]).size, np.unique(a[:, 1]).size]
  
              if np.asscalar(np.diff(ax)):
                  __val_col = np.argmax(ax)
                  __group_col = np.argmin(ax)
              else:
                  raise ValueError('Cannot infer input format.\nPlease specify `val_id` and `group_id` args')
  
              cols = {__val_col: val_col,
                      __group_col: group_col}
          else:
              cols = {val_id: val_col,
                      group_id: group_col}
  
          cols_vals = dict(sorted(cols.items())).values()
          return DataFrame(a, columns=cols_vals), val_col, group_col