<commit_before>"""Forecast IO API"""
import json
import urllib2
import os

apikey = os.getenv('FORECASTIO')
if not apikey:
    print "WARNING: forecast.io key not set."
    print "Realtime weather data not availible."

def data(place):
    lat,lon = place
    url = "https://api.forecast.io/forecast/%s/%s,%s" % (apikey, lat,lon)
#url = apiurl + "%s/summary?key=%s" % (self.system_id,apikey)
    a = json.loads(urllib2.urlopen(url).read())
    return a
<commit_msg>nothing big<commit_after>"""Forecast IO API"""
import json
import urllib2
import os

apikey = os.getenv('FORECASTIO')
if not apikey:
    print "WARNING: forecast.io key not set."
    print "Realtime weather data not availible."

def data(place):
    lat,lon = place
    url = "https://api.forecast.io/forecast/%s/%s,%s" % (apikey, lat,lon)
#url = apiurl + "%s/summary?key=%s" % (self.system_id,apikey)
    a = json.loads(urllib2.urlopen(url).read())
    return a
if __name__ == '__main__':
    lat,lon = (40. ,-78.0)
    url = "https://api.forecast.io/forecast/%s/%s,%s" % (apikey, lat,lon)
    print url

{'fraction_non_alphanumeric': 0.1691588785046729, 'fraction_numerical': 0.008411214953271028, 'mean_word_length': 3.78125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '5161641', 'n_tokens_mistral': 410, 'n_tokens_neox': 403, 'n_words': 97}