<commit_before>import sys
import httplib
from itertools import chain, count
from wsgitest import expect, config
from wsgitest.utils import stderr

def normalize_docstring(docstr):
    if not docstr:
        return docstr
    docstr = docstr.strip('\n')
    return '\n'.join(
        line.lstrip() for line in docstr.split('\n')
    ).replace('\n\n', '\r\n')

class Request(object):
    DEFAULT_DATA = 'GET / HTTP/1.0'''
    def __init__(self, data=None):
        self.data = data or self.DEFAULT_DATA

    def connect(self):
        return httplib.HTTPConnection(
            config.SERVER_HOST,
            config.SERVER_PORT
        )

    def send(self):
        connection = self.connect()
        connection.send(self.data)
        # workahack for httplibs stupid internal state
        connection._HTTPConnection__state = httplib._CS_REQ_SENT
        return connection.getresponse()<commit_msg>Fix default request end sentinel<commit_after>import sys
import httplib
from itertools import chain, count
from wsgitest import expect, config
from wsgitest.utils import stderr

def normalize_docstring(docstr):
    if not docstr:
        return docstr
    docstr = docstr.strip('\n')
    return '\n'.join(
        line.lstrip() for line in docstr.split('\n')
    ).replace('\n\n', '\r\n')

class Request(object):
    data = 'GET / HTTP/1.0\r\n\r\n'''
    def __init__(self, data=None):
        if data is not None:
            self.data = data.rsplit('\r\n\r\n')[0] + '\r\n\r\n'

    def connect(self):
        return httplib.HTTPConnection(
            config.SERVER_HOST,
            config.SERVER_PORT
        )

    def send(self):
        connection = self.connect()
        connection.send(self.data)
        # workahack for httplibs stupid internal state
        connection._HTTPConnection__state = httplib._CS_REQ_SENT
        return connection.getresponse()
{'fraction_non_alphanumeric': 0.1082529474812433, 'fraction_numerical': 0.0026795284030010718, 'mean_word_length': 2.5903846153846155, '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': '4286632', 'n_tokens_mistral': 578, 'n_tokens_neox': 579, 'n_words': 145}