code: def _pandas_indexing(X, key, key_dtype, axis):
      """Index a pandas dataframe or a series"""
      if hasattr(key, "shape"):
          # Work-around for indexing with read-only key in pandas
          # FIXME: solved in pandas 0.25
          key = np.asarray(key)
          key = key if key.flags.writeable else key.copy()
      # check whether we should index with loc or iloc
      indexer = X.iloc if key_dtype == "int" else X.loc
      return indexer[:, key] if axis else indexer[key]
  
imports: import numbers
  import numpy
  from itertools import compress
  from scipy.sparse import issparse
  from sklearn.model_selection import ParameterGrid
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 13 for calling a global function with example usage: _pandas_indexing(X, key, key_dtype, axis) and returns: unknown