<commit_before>
import sys
import web

urls = (
    '/$', 'hello',
    '/rss', 'rss'
)
app = web.application(urls, globals())
rss_builder = None

class hello:        
    def GET(self):
        return """
<html>
<head></head>
<body>
    <h2>Hbase powered feed aggregator</h2>
    <a href="/rss">Global aggregated feed</a> (only the latest 24 hours)<br />
    <br />
    <form action="/rss" method="GET">
        <legend>Customize</legend>
        <label>Category:</label>
        <input  type="text" name="c" />
        <label>Hours:</label>
        <input type="text" name="h" />
        <button type="submit">Do the magic</button>
    </form>
</body>
</html>
"""

class rss:
    def GET(self):
        input = web.input(c='', h=None)
        return rss_builder(input.h, input.c)
       

def start(builder):
    """
    Start the webui and use the given RSS builder for answering queries
    """
    global rss_builder
    rss_builder, sys.argv = builder, []
    app.run()
<commit_msg>fix: set content type for rss content<commit_after>
import sys
import web

urls = (
    '/$', 'hello',
    '/rss', 'rss'
)
app = web.application(urls, globals())
rss_builder = None

class hello:        
    def GET(self):
        return """
<html>
<head></head>
<body>
    <h2>Hbase powered feed aggregator</h2>
    <a href="/rss">Global aggregated feed</a> (only the latest 24 hours)<br />
    <br />
    <form action="/rss" method="GET">
        <legend>Customize</legend>
        <label>Category:</label>
        <input  type="text" name="c" />
        <label>Hours:</label>
        <input type="text" name="h" />
        <button type="submit">Do the magic</button>
    </form>
</body>
</html>
"""

class rss:
    def GET(self):
        web.header("Content-Type","application/rss+xml")
        input = web.input(c='', h=None)
        return rss_builder(input.h, input.c)
       

def start(builder):
    """
    Start the webui and use the given RSS builder for answering queries
    """
    global rss_builder
    rss_builder, sys.argv = builder, []
    app.run()

{'fraction_non_alphanumeric': 0.16739659367396595, 'fraction_numerical': 0.0038929440389294406, 'mean_word_length': 2.563258232235702, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '5151057', 'n_tokens_mistral': 699, 'n_tokens_neox': 684, 'n_words': 177}