<commit_before>from server import app
from .base import cached_route
import requests
import datetime
import os


@app.route('/weather/', methods=['GET'])
def retrieve_weather_data():
    '''Retrieves the current weather from the Open Weather Map API.
    Stores data in a cache whenever data is retrieved; cache is updated
    if it has not been updated within 10 minutes.
    '''
    APPID = os.getenv('APPID')

    def get_data():
        url = 'http://api.openweathermap.org/data/2.5/weather?q=Philadelphia&units=imperial&APPID=%s' % APPID
        json = requests.get(url).json()
        return {'weather_data': json}

    td = datetime.timedelta(seconds=50)

    return cached_route('weather', td, get_data)<commit_msg>forgot to change back to 10 minutes from testing<commit_after>from server import app
from .base import cached_route
import requests
import datetime
import os


@app.route('/weather/', methods=['GET'])
def retrieve_weather_data():
    '''Retrieves the current weather from the Open Weather Map API.
    Stores data in a cache whenever data is retrieved; cache is updated
    if it has not been updated within 10 minutes.
    '''
    APPID = os.getenv('APPID')

    def get_data():
        url = 'http://api.openweathermap.org/data/2.5/weather?q=Philadelphia&units=imperial&APPID=%s' % APPID
        json = requests.get(url).json()
        return {'weather_data': json}

    td = datetime.timedelta(seconds=600)

    return cached_route('weather', td, get_data)
{'fraction_non_alphanumeric': 0.1106612685560054, 'fraction_numerical': 0.010121457489878543, 'mean_word_length': 3.7684887459807075, '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': '3553304', 'n_tokens_mistral': 471, 'n_tokens_neox': 430, 'n_words': 141}