code: def load_data(filename):
          
          file_root, file_ext = os.path.splitext(filename)
          data = None
          if file_ext.lower() in COLOR_IMAGE_EXTS:
              data = cv2.cvtColor(cv2.imread(filename), cv2.COLOR_BGR2RGB)
          elif file_ext == '.npy':
              data = np.load(filename)
          elif file_ext == '.npz':
              data = np.load(filename)['arr_0']
          else:
              raise ValueError('Extension %s not supported' % (file_ext))
          return data
docs: Loads a data matrix from a given file.
  
          Parameters
          ----------
          filename : :obj:`str`
              The file to load the data from. Must be one of .png, .jpg,
              .npy, or .npz.
  
          Returns
          -------
          :obj:`numpy.ndarray`
              The data array read from the file.