<commit_before>import os
from urllib.request import urlretrieve
import pandas as pd

FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD'

def get_fremont_data(filename='Fremont.csv', url=FREMONT_URL, force_download=False):
    ''''Download and cache Fremont data

    Parameters
    -----------
    filename : string (optional)
    	location to save the data
    url : string (optional)
    	web location of the data
    force_download : bool (optional)
    	if True, force redownload of the data

    Returns
    --------
    data : pandas.DataFrame
    	The Fremont bridge data
    '''

    if force_download or not os.path.exists(filename):
        urlretrieve(URL, 'Fremont.csv')
    data = pd.read_csv('Fremont.csv', index_col='Date', parse_dates=True)
    data.columns = ['West', 'East']
    data['Total'] = data['East'] + data['West']
    return data<commit_msg>refactor<commit_after>import os
from urllib.request import urlretrieve
import pandas as pd

FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD'

def get_fremont_data(filename='Fremont.csv', url=FREMONT_URL, force_download=False):
    ''''Download and cache Fremont data

    Parameters
    -----------
    filename : string (optional)
    	location to save the data
    url : string (optional)
    	web location of the data
    force_download : bool (optional)
    	if True, force redownload of the data

    Returns
    --------
    data : pandas.DataFrame
    	The Fremont bridge data
    '''

    if force_download or not os.path.exists(filename):
        urlretrieve(URL, 'Fremont.csv')
    data = pd.read_csv('Fremont.csv', index_col='Date')
    try:
        data.index = pd.to_datetime(data.index, format='%m/%d/%Y %H:%M:%S %p')
    except TypeError:
        data.index = pd.to_datetime(data.index)
    
    data.columns = ['West', 'East']
    data['Total'] = data['East'] + data['West']
    return data
{'fraction_non_alphanumeric': 0.13254861821903788, 'fraction_numerical': 0.0030706243602865915, 'mean_word_length': 3.0644490644490645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4517836', 'n_tokens_mistral': 653, 'n_tokens_neox': 632, 'n_words': 156}