code: def _training_data_to_numpy(X, y):
      """Convert input training data into numpy format"""
      if isinstance(X, np.ndarray):
          X_np = X
          y_np = y
      elif isinstance(X, cp.ndarray):
          X_np = cp.asnumpy(X)
          y_np = cp.asnumpy(y)
      elif isinstance(X, cudf.DataFrame):
          X_np = X.to_numpy()
          y_np = y.to_numpy()
      elif cuda.devicearray.is_cuda_ndarray(X):
          X_np = X.copy_to_host()
          y_np = y.copy_to_host()
      elif isinstance(X, (pd.DataFrame, pd.Series)):
          X_np = datagen._convert_to_numpy(X)
          y_np = datagen._convert_to_numpy(y)
      else:
          raise TypeError("Received unsupported input type")
      return X_np, y_np
  
imports: from cuml.manifold import UMAP
  from cuml.benchmark import datagen
  from cuml.common.device_selection import using_device_type
  from cuml.internals.device_type import DeviceType
  from cuml.internals.global_settings import GlobalSettings
  from cuml.internals.safe_imports import cpu_only_import, gpu_only_import, gpu_only_import_from, safe_import
  import sklearn.ensemble
  import pickle
  import os
  import cuml
  from cuml.internals import input_utils
  from time import perf_counter
label_desc: Use image node_id 10 for calling a global function with example usage: _training_data_to_numpy(X, y) and returns: X_np,  y_np