class_docstr: Mixin class with utilities for by-column applicates.
docstr: Check getattr(self, est_attr) attribute, and coerce to (name, est, index).
  
  Checks:
  
  * `getattr(self, est_attr)` is single estimator, or
  * `getattr(self, est_attr)` is list of (name, estimator, index)
  * all `estimator` above inherit from `cls` (`None` means `BaseEstimator`)
  * `X.columns` is disjoint union of `index` appearing above
  
  Parameters
  ----------
  X : `pandas` object with `columns` attribute of `pd.Index` type
  X_name : str, optional, default = "X"
      name of `X` displayed in error messages
  est_attr : str, optional, default = "estimators"
      attribute name of the attribute this function checks
      also used in error message
  cls : type, optional, default = sktime BaseEstimator
      class to check inheritance from, for estimators (see above)
  
  Returns
  -------
  list of (name, estimator, index) such that union of index is `X.columns`;
  and estimator is estimator inheriting from `cls`
  
  Raises
  ------
  ValueError if checks fail, with informative error message
docstr_tok: ["Check","getattr","(","self",",","est_attr",")","attribute",",","and","coerce","to","(","name",",","est",",","index",")",".","Checks",":","*","`","getattr","(","self",",","est_attr",")","`","is","single","estimator",",","or","*","`","getattr","(","self",",","est_attr",")","`","is","list","of","(","name",",","estimator",",","index",")","*","all","`","estimator","`","above","inherit","from","`","cls","`","(","`","None","`","means","`","BaseEstimator","`",")","*","`","X.columns","`","is","disjoint","union","of","`","index","`","appearing","above","Parameters","--","--","--","--","--","X",":","`","pandas","`","object","with","`","columns","`","attribute","of","`","pd.Index","`","type","X_name",":","str",",","optional",",","default","=","``","X","''","name","of","`","X","`","displayed","in","error","messages","est_attr",":","str",",","optional",",","default","=","``","estimators","''","attribute","name","of","the","attribute","this","function","checks","also","used","in","error","message","cls",":","type",",","optional",",","default","=","sktime","BaseEstimator","class","to","check","inheritance","from",",","for","estimators","(","see","above",")","Returns","--","--","--","-","list","of","(","name",",","estimator",",","index",")","such","that","union","of","index","is","`","X.columns","`",";","and","estimator","is","estimator","inheriting","from","`","cls","`","Raises","--","--","--","ValueError","if","checks","fail",",","with","informative","error","message"]
code: def _check_col_estimators(
      self, X, X_name="X", est_attr="estimators", cls=None
  ):
      """Check getattr(self, est_attr) attribute, and coerce to (name, est, index).
  
      Checks:
  
      * `getattr(self, est_attr)` is single estimator, or
      * `getattr(self, est_attr)` is list of (name, estimator, index)
      * all `estimator` above inherit from `cls` (`None` means `BaseEstimator`)
      * `X.columns` is disjoint union of `index` appearing above
  
      Parameters
      ----------
      X : `pandas` object with `columns` attribute of `pd.Index` type
      X_name : str, optional, default = "X"
          name of `X` displayed in error messages
      est_attr : str, optional, default = "estimators"
          attribute name of the attribute this function checks
          also used in error message
      cls : type, optional, default = sktime BaseEstimator
          class to check inheritance from, for estimators (see above)
  
      Returns
      -------
      list of (name, estimator, index) such that union of index is `X.columns`;
      and estimator is estimator inheriting from `cls`
  
      Raises
      ------
      ValueError if checks fail, with informative error message
      """
      if cls is None:
          cls = BaseEstimator
  
      estimators = getattr(self, est_attr)
  
      # if a single estimator is passed, replicate across columns
      if isinstance(estimators, cls):
          ycols = [str(col) for col in X.columns]
          colrange = range(len(ycols))
          est_list = [estimators.clone() for _ in colrange]
          return list(zip(ycols, est_list, colrange))
  
      if (
          estimators is None
          or len(estimators) == 0
          or not isinstance(estimators, list)
      ):
          raise ValueError(
              f"Invalid '{est_attr}' attribute, '{est_attr}' should be a list"
              " of (string, estimator, int) tuples."
          )
      names, ests, indices = zip(*estimators)
  
      # check names, via _HeterogenousMetaEstimator._check_names
      if hasattr(self, "_check_names"):
          self._check_names(names)
  
      # coerce column names to indices in columns
      indices = self._get_indices(X, indices)
  
      for est in ests:
          if not isinstance(est, cls):
              raise ValueError(
                  f"The estimator {est.__class__.__name__} should be of type "
                  f"{cls}."
              )
  
      index_flat = flatten(indices)
      index_set = set(index_flat)
      not_in_y_idx = index_set.difference(X.columns)
      y_cols_not_found = set(X.columns).difference(index_set)
  
      if len(not_in_y_idx) > 0:
          raise ValueError(
              f"Column identifier must be indices in {X_name}.columns, or integers "
              f"within the range of the total number of columns, "
              f"but found column identifiers that are neither: {list(not_in_y_idx)}"
          )
      if len(y_cols_not_found) > 0:
          raise ValueError(
              f"All columns of {X_name} must be indexed by column identifiers, but "
              f"the following columns of {X_name} are not indexed: "
              f"{list(y_cols_not_found)}"
          )
  
      if len(index_set) != len(index_flat):
          raise ValueError(
              f"One estimator per column required. Found {len(index_set)} unique"
              f" column names in {est_attr} arg, required {len(index_flat)}"
          )
  
      return estimators
  
imports: from inspect import isclass
  import numpy
  import pandas
  from sktime.base import BaseEstimator
label_desc: Use image node_id 4 for calling the _ColumnEstimator obj's underlying member method code with example usage: obj._check_col_estimators(X, X_name, est_attr, cls) and returns: estimators, list