code: def safe_indexing(X, indices):
      """Slice an array or dataframe. This is deprecated in sklearn"""
      if hasattr(X, "iloc"):
          return X.iloc[indices]
      # numpy:
      # TODO: this does not currently support axis 1
      if hasattr(X, "ndim") and X.ndim == 2:
          return X[indices, :]
      # list or 1d array
      return X[indices]
  
imports: from packaging.version import Version
  import sklearn
  from sklearn.exceptions import NotFittedError
label_desc: Use image node_id 2 for calling a global function with example usage: safe_indexing(X, indices) and returns: X, X, X