<commit_before>import os
import urllib
import datetime
import csv
import unicodecsv

def daterange(start, stop, step_days=1):
	current = start
	step = datetime.timedelta(step_days)
	if step_days > 0:
		while current < stop:
			yield current
			current += step
	elif step_days < 0:
		while current > stop:
			yield current
			current += step
	else:
		raise ValueError("daterange() step_days argument must not be zero")



date_format = '%Y-%m-%d'
step = 1
DOWNLOADS_DIR = './cache'
year = 2017
url = "http://earthquake.usgs.gov/fdsnws/event/1/query?format=csv&starttime={0}%2000:00:00&minmagnitude=0.1&format=csv&endtime={1}%2023:59:59&maxmagnitude=10&orderby=time-asc"

startRange = datetime.date(year, 1, 1)
endRange = datetime.date(year+1, 1, 1)
today = datetime.date.today()

for i in daterange(startRange, endRange, step):
	start = i.strftime(date_format)
	end = (i+datetime.timedelta(days=step-1)).strftime(date_format)
	query = os.path.join(DOWNLOADS_DIR, start + "_" + end + ".csv")
	if ((i+datetime.timedelta(days=step-1)) <= today):
		try:
			if not os.path.isfile(query):<commit_msg>Updated time format in URL<commit_after>import os
import urllib
import datetime
import csv
import unicodecsv

def daterange(start, stop, step_days=1):
	current = start
	step = datetime.timedelta(step_days)
	if step_days > 0:
		while current < stop:
			yield current
			current += step
	elif step_days < 0:
		while current > stop:
			yield current
			current += step
	else:
		raise ValueError("daterange() step_days argument must not be zero")



date_format = '%Y-%m-%d'
step = 1
DOWNLOADS_DIR = './cache'
year = 2017
url = "http://earthquake.usgs.gov/fdsnws/event/1/query?format=csv&starttime={0}T00:00:00&minmagnitude=0.1&format=csv&endtime={1}T23:59:59&maxmagnitude=10&orderby=time-asc"

startRange = datetime.date(year, 1, 1)
endRange = datetime.date(year+1, 1, 1)
today = datetime.date.today()

for i in daterange(startRange, endRange, step):
	start = i.strftime(date_format)
	end = (i+datetime.timedelta(days=step-1)).strftime(date_format)
	query = os.path.join(DOWNLOADS_DIR, start + "_" + end + ".csv")

	if ((i+datetime.timedelta(days=step-1)) <= today):
		try:
			if not os.path.isfile(query):
{'fraction_non_alphanumeric': 0.1429872495446266, 'fraction_numerical': 0.03278688524590164, 'mean_word_length': 5.002732240437158, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5371572', 'n_tokens_mistral': 904, 'n_tokens_neox': 811, 'n_words': 181}