<commit_before>__author__ = 'reggie'


import re
from socket import *


import PmkSeed
from PmkShared import *





class Head(object):

    def __init__(self, header):
        self.params_hash = {}
        self.params_list = []
        self.params_string = ""
        hd = re.findall(r"(GET|POST) (?P<value>.*?)\s", header)
        if len(hd[0][1].split("?")) > 1:
            parlist = hd[0][1].split("?")[1].split("&")
            for p in parlist:
                key = p.split("=")[0]
                value = p.split("=")[1]
                self.params_hash[key] = value
                self.params_list.append(value)
                self.params_string += str(value)+","

            self.params_string = self.params_string[:-1]

        serv = hd[0][1].split("?")[0].split("/")
        self.module = serv[len(serv)-2]
        self.method = serv[len(serv)-1]




class HttpServer(SThread):


    def __init__(self, context):
        SThread.__init__(self)
        self.context = context
        pass

    def getSize(self, filestr):
        fileobject = open(filestr, 'rb')
        fileobject.seek(0,2) # move the cursor to the end of the file
        size = fileobject.tell()
        fileobject.close()
        return size

    def run(self):
<commit_msg>http server bug<commit_after>__author__ = 'reggie'


import re
from socket import *


import PmkSeed
from PmkShared import *





class Head(object):

    def __init__(self, header):
        self.params_hash = {}
        self.params_list = []
        self.params_string = ""
        hd = re.findall(r"(GET|POST) (?P<value>.*?)\s", header)
        try:
            if len(hd[0][1].split("?")) > 1:
                parlist = hd[0][1].split("?")[1].split("&")
                for p in parlist:
                    key = p.split("=")[0]
                    value = p.split("=")[1]
                    self.params_hash[key] = value
                    self.params_list.append(value)
                    self.params_string += str(value)+","

                self.params_string = self.params_string[:-1]

            serv = hd[0][1].split("?")[0].split("/")
            self.module = serv[len(serv)-2]
            self.method = serv[len(serv)-1]
        except:
            self.module = None
            self.method = None




class HttpServer(SThread):


    def __init__(self, context):
        SThread.__init__(self)
        self.context = context
        pass

    def getSize(self, filestr):
        fileobject = open(filestr, 'rb')
        fileobject.seek(0,2) # move the cursor to the end of the file
        size = fileobject.tell()
        fileobject.close()
        return size

    def run(self):

{'fraction_non_alphanumeric': 0.1464513706346226, 'fraction_numerical': 0.012016522718738265, 'mean_word_length': 1.855305466237942, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6240643', 'n_tokens_mistral': 872, 'n_tokens_neox': 822, 'n_words': 172}