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()
      elif isinstance(key, tuple):
          key = list(key)
  
      if key_dtype == "int" and not (
          isinstance(key, slice) or np.isscalar(key)
      ):
          # using take() instead of iloc[] ensures the return value is a "proper"
          # copy that will not raise SettingWithCopyWarning
          return X.take(key, axis=axis)
      else:
          # 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 functools
  import logging
  import numbers
  import time
  import warnings
  from collections import Counter
  from contextlib import suppress
  from itertools import compress
  from traceback import format_exc
  import numpy
  import scipy.sparse
  from catboost import CatBoostClassifier, CatBoostRegressor
  from joblib import Parallel, logger
  from scipy.sparse import issparse
  from sklearn import config_context, get_config
  from sklearn.base import clone, is_classifier
  from sklearn.exceptions import FitFailedWarning, NotFittedError
  from sklearn.metrics import check_scoring
  from sklearn.metrics._scorer import _MultimetricScorer
  from sklearn.model_selection import check_cv
  from sklearn.utils.fixes import np_version, parse_version
  from sklearn.utils.validation import indexable
label_desc: Use image node_id 14 for calling a global function with example usage: _pandas_indexing(X, key, key_dtype, axis) and returns: X, unknown