<commit_before>from urllib.request import Request, urlopen,  URLError
from urllib.parse import urlencode, quote
import simplejson as json

import globs

# Accuweather API key
#set in globs.py
api_key = globs.API_KEY
# Developer URL
base_url = "http://dataservice.accuweather.com"

# API endpoints
loc_call = "/locations/v1/search"
loc_cur ="/currentconditions/v1/"
loc_fore="/forecasts/v1/daily/1day/"

# Test data 
ap = input("Town/City: ")
sp = quote(ap)# encode and quote input string

# Build URLs
url_loc = base_url + loc_call
url_cur = base_url + loc_cur
url_for = base_url + loc_fore

#Search for location id and store
urlsend = url_loc + "?"  + "apikey=" + api_key + "&q=" + sp
myURL = urlopen(urlsend).read()
#print(myURL)
#if (len(json.loads(myURL)) < 1):
#    print('future')

<commit_msg>tidy up<commit_after>from urllib.request import Request, urlopen,  URLError
from urllib.parse import urlencode, quote
import simplejson as json

import globs

# Accuweather API key
#set in globs.py
api_key = globs.API_KEY
# Developer URL
base_url = "http://dataservice.accuweather.com"

# API endpoints
loc_call = "/locations/v1/search"
loc_cur ="/currentconditions/v1/"
loc_fore="/forecasts/v1/daily/1day/"

# Test data 
ap = input("Town/City: ")
sp = quote(ap)# encode and quote input string

# Build URLs
url_loc = base_url + loc_call
url_cur = base_url + loc_cur
url_for = base_url + loc_fore

#Search for location id and store
urlsend = url_loc + "?"  + "apikey=" + api_key + "&q=" + sp
myURL = urlopen(urlsend).read()
{'fraction_non_alphanumeric': 0.12344057780695995, 'fraction_numerical': 0.005909389363099146, 'mean_word_length': 4.707865168539326, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7608582', 'n_tokens_mistral': 580, 'n_tokens_neox': 557, 'n_words': 150}