code: def download_and_parse_mnist_file(fname, target_dir=None, force=False):
      
      fname = download_file(fname, target_dir=target_dir, force=force)
      fopen = gzip.open if os.path.splitext(fname)[1] == '.gz' else open
      with fopen(fname, 'rb') as fd:
          return parse_idx(fd)
docs: Download the IDX file named fname from the URL specified in dataset_url
      and return it as a numpy array.
  
      Parameters
      ----------
      fname : str
          File name to download and parse
  
      target_dir : str
          Directory where to store the file
  
      force : bool
          Force downloading the file, if it already exists
  
      Returns
      -------
      data : numpy.ndarray
          Numpy array with the dimensions and the data in the IDX file