<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
from armet import http
from six.moves import cStringIO as StringIO
from twisted.internet import reactor


class Request(http.Request):

    class Headers(http.request.Headers):

        def __init__(self, request):
            self._handle = request._handle
            super(Headers, self).__init__(request)

        def __getitem__(self, name):
            return self._handle.headers[name]

        def __iter__(self):
            return iter(self._handle.headers)

        def __len__(self):
            return len(self._handle.headers)

        def __contains__(self, name):
            return name in self._handle.headers

    def __init__(self, handler, *args, **kwargs):
        self._handle = handler.request
        self._stream = StringIO(self._handle.body)
        kwargs.update(method=self._handle.method)
        super(Request, self).__init__(*args, **kwargs)

    @property
    def protocol(self):
        return self._handle.protocol.upper()

    @property
    def host(self):
        return self._handle.host

    @property
    def query(self):
        return self._handle.query

    @property
    def uri(self):
        return self._handle.full_url()

    def read(self, count=-1):
        return self._stream.read(count)

    def readline(self, limit=-1):
        return self._stream.readline(limit)

    def readlines(self, hint=-1):
        return self._stream.readlines(hint)


class Response(http.Response):

    class Headers(http.response.Headers):

        def __init__(self, response):
            self._handler = response._handler
            super(Headers, self).__init__(response)

        def __setitem__(self, name, value):<commit_msg>Fix cyclone test.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
from armet import http
from six.moves import cStringIO as StringIO
from twisted.internet import reactor


class Request(http.Request):

    class Headers(http.request.Headers):

        def __init__(self, request):
            self._handle = request._handle
            super(Request.Headers, self).__init__(request)

        def __getitem__(self, name):
            return self._handle.headers[name]

        def __iter__(self):
            return iter(self._handle.headers)

        def __len__(self):
            return len(self._handle.headers)

        def __contains__(self, name):
            return name in self._handle.headers

    def __init__(self, handler, *args, **kwargs):
        self._handle = handler.request
        self._stream = StringIO(self._handle.body)
        kwargs.update(method=self._handle.method)
        super(Request, self).__init__(*args, **kwargs)

    @property
    def protocol(self):
        return self._handle.protocol.upper()

    @property
    def host(self):
        return self._handle.host

    @property
    def query(self):
        return self._handle.query

    @property
    def uri(self):
        return self._handle.full_url()

    def read(self, count=-1):
        return self._stream.read(count)

    def readline(self, limit=-1):
        return self._stream.readline(limit)

    def readlines(self, hint=-1):
        return self._stream.readlines(hint)


class Response(http.Response):

    class Headers(http.response.Headers):

        def __init__(self, response):
            self._handler = response._handler
            super(Response.Headers, self).__init__(response)

        def __setitem__(self, name, value):
{'fraction_non_alphanumeric': 0.10513036164844407, 'fraction_numerical': 0.00224278104850014, 'mean_word_length': 2.596774193548387, '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': '913701', 'n_tokens_mistral': 1012, 'n_tokens_neox': 969, 'n_words': 235}