<commit_before>#!/usr/bin/python
from __future__ import print_function
from urllib import request
import zipfile
import os


def download_file(skip_this=False):
    """Download the dataset from a website
    then unzip it.
    """

    if not skip_this:

        if not os.path.isdir("../../baseballdatabank-2017.1"):

            print("Starting download")
            # Get baseball data in csv form from website
            url = "http://seanlahman.com/files/database/baseballdatabank-2017.1.zip"
            request.urlretrieve(url, filename="../../baseballdatabank-2017.1.zip")

            # Unzip the dataset in the folder above the repo.
            with zipfile.ZipFile("../../baseballdatabank-2017.1.zip", "r") as zfile:
                zfile.extractall(".")
            print("Data downloaded and unzipped")
            print("This database is copyright 1996-2017 by <NAME>.")
            print("Data licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.")

        else:
            print("Data not downloaded")<commit_msg>bug: Changed getdata.py to place zip file in correct place<commit_after>#!/usr/bin/python
from __future__ import print_function
from urllib import request
import zipfile
import os


def download_file(skip_this=False):
    """Download the dataset from a website
    then unzip it.
    """

    if not skip_this:

        if not os.path.isdir("../../baseballdatabank-2017.1"):

            print("Starting download")
            # Get baseball data in csv form from website
            url = "http://seanlahman.com/files/database/baseballdatabank-2017.1.zip"
            request.urlretrieve(url, filename="../../baseballdatabank-2017.1.zip")

            # Unzip the dataset in the folder above the repo.
            with zipfile.ZipFile("../../baseballdatabank-2017.1.zip", "r") as zfile:
                zfile.extractall("../../")
            print("Data downloaded and unzipped")
            print("This database is copyright 1996-2017 by <NAME>.")
            print("Data licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.")

        else:
            print("Data not downloaded")
{'fraction_non_alphanumeric': 0.11290322580645161, 'fraction_numerical': 0.027649769585253458, 'mean_word_length': 2.3816199376947043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2927639', 'n_tokens_mistral': 668, 'n_tokens_neox': 599, 'n_words': 176}