code: def _download_dataset(
      url, md5, dataset_name, train_file, test_file, cache=False
  ):
      # TODO(yazevnul): this is not thread safe (or process safe?), we should take a file lock when
      # enter this function to avoid dataset being overwritten or corrupted or something else that may
      # have happen when OS operated simultaneously on the same file. Same thing should probably be
      # done with `_cached_download`.
      dir_path = (
          os.path.join(_get_cache_path(), dataset_name)
          if cache
          else tempfile.mkdtemp()
      )
      train_path = os.path.join(dir_path, train_file)
      test_path = os.path.join(dir_path, test_file)
      if not (os.path.exists(train_path) and os.path.exists(test_path)):
          _ensure_dir_exists(dir_path)
          file_descriptor, file_path = tempfile.mkstemp()
          os.close(file_descriptor)
          try:
              _cached_download(url, md5, file_path)
              _extract(file_path, dir_path)
          finally:
              os.remove(file_path)
      # move files for safe delete of temp dir
      if not cache:
          new_train_path = tempfile.mktemp()
          new_test_path = tempfile.mktemp()
          os.rename(train_path, new_train_path)
          os.rename(test_path, new_test_path)
          shutil.rmtree(dir_path)
          train_path, test_path = new_train_path, new_test_path
      return train_path, test_path
  
imports: import hashlib
  import logging
  import numpy
  import os
  import pandas
  import tarfile
  import tempfile
  import six
  import shutil
  from .core import PATH_TYPES, fspath
label_desc: Use image node_id 7 for calling a global function with example usage: _download_dataset(url, md5, dataset_name, train_file, test_file, cache) and returns: train_path,  test_path