code: def _get_column(X, key):
      """Get feature column(s) from input data X.
  
      Supported input types (X): numpy arrays and DataFrames
  
      Supported key types (key):
      - scalar: output is 1D
      - lists, slices, boolean masks: output is 2D
      - callable that returns any of the above
  
      Supported key data types:
  
      - integer or boolean mask (positional):
          - supported for arrays, sparse matrices and dataframes
      - string (key-based):
          - only supported for dataframes
          - So no keys other than strings are allowed (while in principle you
            can use any hashable object as key).
      """
      # check whether we have string column names or integers
      if _check_key_type(key, int):
          column_names = False
      elif _check_key_type(key, str):
          column_names = True
      elif hasattr(key, "dtype") and np.issubdtype(key.dtype, np.bool_):
          # boolean mask
          column_names = True
      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"
          )
  
      # ensure that pd.DataFrame is returned rather than
      # pd.Series
      if isinstance(key, (int, str)):
          key = [key]
  
      if column_names:
          if not isinstance(X, pd.DataFrame):
              raise ValueError(
                  f"X must be a pd.DataFrame if column names are "
                  f"specified, but found: {type(X)}"
              )
          return X.loc[:, key]
      else:
          if isinstance(X, np.ndarray):
              return X[:, key]
          return X.iloc[:, key]
  
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 1 for calling a global function with example usage: _get_column(X, key) and returns: X, X, X