code: def save_data(X, y, path):
      
      catalog = {'.csv': save_csv, '.sps': save_libsvm, '.h5': save_hdf5}
  
      ext = os.path.splitext(path)[1]
      func = catalog[ext]
  
      if y is None:
          y = np.zeros((X.shape[0], ))
  
      func(X, y, path)
docs: Save data as a CSV, LibSVM or HDF5 file based on the file extension.
  
      Args:
          X (numpy or scipy sparse matrix): Data matrix
          y (numpy array): Target vector. If None, all zero vector will be saved.
          path (str): Path to the CSV, LibSVM or HDF5 file to save data.