<commit_before>from flask import request, Response
from .base import *
from server import app
import requests
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

@app.route('/nso')
def get_nso_events():
    r = requests.get("http://www.nso.upenn.edu/event-calendar.rss")
    split = r.text.split("\n")
    filtered = [i if  "<pubDate" not in i else "<pubDate>Wed, 02 Aug 2016 08:00:00 EST</pubDate>" for i in split]
    output = "\n".join(filtered)
    return Response(output, mimetype="text/xml")<commit_msg>Set time back four hours to EST<commit_after>from flask import request, Response
from .base import *
from server import app
import requests
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

@app.route('/nso')
def get_nso_events():
    r = requests.get("http://www.nso.upenn.edu/event-calendar.rss")
    split = r.text.split("\n")
    filtered = [i if "<pubDate" not in i else "<pubDate>Wed, 02 Aug 2016 08:00:00 EST</pubDate>" for i in split]
    filtered = [i if ("<title" not in i or "NSO Event Calendar" in i) else changeTitle(i) for i in filtered]
    output = "\n".join(filtered)
    return Response(output, mimetype="text/xml")

def changeTitle(a):
    index = a.index("event") + 17
    a = subFour(a,index)
    if a[index+6] == '-':
        a = subFour(a,index + 18)
    return a

def subFour(string, index):
    val = string[index:index+6]
    new_val = str(int(val) - 40000)
    if len(new_val) < 6:
        new_val = "0" + new_val
    return string.replace(val, new_val)

{'fraction_non_alphanumeric': 0.14539473684210527, 'fraction_numerical': 0.025657894736842105, 'mean_word_length': 3.708978328173375, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '599766', 'n_tokens_mistral': 566, 'n_tokens_neox': 522, 'n_words': 155}