code: def _get_column_indices(X, key):
      """Get feature column indices for input data X and key.
  
      For accepted values of `key`, see the docstring of _get_column
      """
      n_columns = X.shape[1]
  
      if (
          _check_key_type(key, int)
          or hasattr(key, "dtype")
          and np.issubdtype(key.dtype, np.bool_)
      ):
          # Convert key into positive indexes
          idx = np.arange(n_columns)[key]
          return np.atleast_1d(idx).tolist()
      elif _check_key_type(key, str):
          try:
              all_columns = list(X.columns)
          except AttributeError:
              raise ValueError(
                  "Specifying the columns using strings is only "
                  "supported for pandas DataFrames"
              )
          if isinstance(key, str):
              columns = [key]
          elif isinstance(key, slice):
              start, stop = key.start, key.stop
              if start is not None:
                  start = all_columns.index(start)
              if stop is not None:
                  # pandas indexing with strings is endpoint included
                  stop = all_columns.index(stop) + 1
              else:
                  stop = n_columns + 1
              return list(range(n_columns)[slice(start, stop)])
          else:
              columns = list(key)
  
          return [all_columns.index(col) for col in columns]
      else:
          raise ValueError(
              "No valid specification of the columns. Only a "
              "scalar, list or slice of all integers or all "
              "strings, or boolean mask is allowed"
          )
  
imports: from itertools import chain
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from sktime.base import _HeterogenousMetaEstimator
  from sktime.classification.base import BaseClassifier
label_desc: Use image node_id 3 for calling a global function with example usage: _get_column_indices(X, key) and returns: np, unknown, list