<commit_before>
import numpy as np
import pickle
import os
import sys
import ws.bad as bad

mydir = os.path.abspath(os.path.dirname(__file__))

print(mydir)

lookupmatrix = pickle.load(open( \
                               mydir +'/accuweather_location_codes.dump','rb'))

lookuplist = lookupmatrix.tolist()

def build_url(city):
    # check whether input is a string
    if type(city) != str:
        raise(bad.Type("The input city " +str(city) +" wasn't of type string"))
        
    
    index = lookuplist[1].index(city)
    accuweather_index = lookuplist[0][index]
    
    url = 'http://realtek.accu-weather.com/widget/realtek/weather-data.asp' \
          + '?location=cityId:' \
          + str(accuweather_index)

    return url<commit_msg>Use os.path.join() to join paths<commit_after>import numpy as np
import pickle
import os
import sys
import ws.bad as bad

mydir = os.path.abspath(os.path.dirname(__file__))
lookupmatrix = pickle.load(open(os.path.join(mydir, 'accuweather_location_codes.dump'), 'rb'))
lookuplist = lookupmatrix.tolist()

def build_url(city):
    # check whether input is a string
    if type(city) != str:
        raise(bad.Type("The input city " +str(city) +" wasn't of type string"))

    index = lookuplist[1].index(city)
    accuweather_index = lookuplist[0][index]

    url = 'http://realtek.accu-weather.com/widget/realtek/weather-data.asp' \
          + '?location=cityId:' \
          + str(accuweather_index)

    return url
{'fraction_non_alphanumeric': 0.12951601908657123, 'fraction_numerical': 0.0027266530334014998, 'mean_word_length': 3.1823361823361824, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2213255', 'n_tokens_mistral': 516, 'n_tokens_neox': 490, 'n_words': 107}