<commit_before>import json
import logging
import tornado.web
import tornado.ioloop

from tornado.options import define, options, parse_command_line
from tornado.httpclient import AsyncHTTPClient, HTTPRequest

define("port", default=8765, help="run on the given port", type=int)
define("debug", default=True, help="run in debug mode")

class WebhookReceiver(tornado.web.RequestHandler):

    def post(self):
        body = json.loads(self.request.body)
        url = body['address']

        httpclient = AsyncHTTPClient()
        request = HTTPRequest(
            url = url,
            method = 'POST',
            headers = {
                'Content-Type': 'application/json'
            },
            body = data
        )

        httpclient.fetch(request, request_handler)

        self.finish()

    def request_handler(self):
        pass

def main():
    parse_command_line()

    app = tornado.web.Application(
        [
            (r"/", WebhookReceiver)
        ],
        debug = options.debug
    )

    app.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()

if __name__ == "__main__":
    main()<commit_msg>scope<commit_after>import json
import logging
import tornado.web
import tornado.ioloop

from tornado.options import define, options, parse_command_line
from tornado.httpclient import AsyncHTTPClient, HTTPRequest

define("port", default=8765, help="run on the given port", type=int)
define("debug", default=True, help="run in debug mode")

class WebhookReceiver(tornado.web.RequestHandler):

    def post(self):
        body = json.loads(self.request.body)
        url = body['address']

        httpclient = AsyncHTTPClient()
        request = HTTPRequest(
            url = url,
            method = 'POST',
            headers = {
                'Content-Type': 'application/json'
            },
            body = self.request.body
        )

        httpclient.fetch(request, self.request_handler)

        self.finish()

    def request_handler(self, response):
        pass

def main():
    parse_command_line()

    app = tornado.web.Application(
        [
            (r"/", WebhookReceiver)
        ],
        debug = options.debug
    )

    app.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.1103388357949609, 'fraction_numerical': 0.0034752389226759338, 'mean_word_length': 2.4219910846953936, 'pattern_counts': {'":': 2, '<': 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': '493093', 'n_tokens_mistral': 675, 'n_tokens_neox': 644, 'n_words': 150}