<jupyter_start><jupyter_text>This is a simple script to download the Caltech256 image feature dataset.<jupyter_code>DATASET_URL = r"http://homes.esat.kuleuven.be/~tuytelaa/"\
"unsup/unsup_caltech256_dense_sift_1000_bow.tar.gz"
DESTINATION_DIR = "../../../projects/weiyen/data"
filename = os.path.split(DATASET_URL)[1]
dest_path = os.path.join(DESTINATION_DIR, filename)

if os.path.exists(dest_path):
    print("{} exists. Skipping download...".format(dest_path))
else:
    with urllib.request.urlopen(DATASET_URL) as response, open(dest_path, 'wb') as out_file:
        shutil.copyfileobj(response, out_file)
        print("Dataset downloaded. Extracting files...")

tar = tarfile.open(dest_path)
tar.extractall(path=DESTINATION_DIR)
print("Files extracted.")
tar.close()<jupyter_output>Dataset downloaded. Extracting files...
Files extracted.
{'fraction_non_alphanumeric': 0.1386255924170616, 'fraction_numerical': 0.013033175355450236, 'mean_word_length': 5.3059701492537314, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '556314', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 311, 'n_tokens_neox': 303, 'n_words': 53, 'path': 'mclearn/knfst/python/dataset_downloader.ipynb', 'repo_name': 'chengsoonong/mclass-sky', 'size': '844'}