code: def _preprocess(X):
      """
      Check if X is a DataFrame or not, and returns numpy ndarray and name of features.
  
      Parameters
      ----------
      X : DataFrame or numpy.ndarray
          A DataFrame or a 2D numpy.ndarray
  
      Returns
      -------
      X_ : numpy.ndarray
          A 2D array that is equivalanet to X.to_numpy()
  
      features_names : List
          A list consisting of name of features. When `X` is a DataFrame, it contains
          the name of columns. If it is a 2D array, it is None.
      """
      if X.ndim != 2:
          raise ValueError(
              f"The input X must be 2D array. Got {X.ndim}"
          )
  
      if type(X).__name__ == "DataFrame":
          features_names = list(X.columns)
          X_ = X.to_numpy(copy=True)
      else:
          # it is numpy array
          features_names = None
          X_ = X.copy()
  
      return X_, features_names
  
imports: from copy import deepcopy
  import numpy
  from sklearn.model_selection import cross_val_score
label_desc: Use image node_id 3 for calling a global function with example usage: _preprocess(X) and returns: X_,  features_names