code: def _safe_split(y, X, train, test):
      """Performs the CV indexing given the indices"""
      y_train, y_test = y.take(train), y.take(test)
      if X is None:
          X_train = X_test = None
      else:
          X_train, X_test = safe_indexing(X, train), safe_indexing(
              X, test
          )
      return y_train, y_test, X_train, X_test
  
imports: import numpy
  import numbers
  import warnings
  import time
  from traceback import format_exception_only
  from sklearn import base
  from sklearn.metrics import mean_absolute_error, mean_squared_error
  from sklearn.utils import indexable
  from ._split import check_cv
  from ..None import metrics
  from ..utils import check_endog
  from ..warnings import ModelFitWarning
  from ..compat.sklearn import safe_indexing
label_desc: Use image node_id 4 for calling a global function with example usage: _safe_split(y, X, train, test) and returns: y_train,  y_test,  X_train,  X_test