<commit_before># -*- coding: utf-8 -
#
# This file is part of http-parser released under the MIT license.
# See the NOTICE for more information.

import os
import re
import zlib

try:
    import urlparse
    from urllib import unquote
except ImportError:
    import urllib.parse as urlparse  # NOQA
    from urllib.parse import unquote  # NOQA

from .headers import Headers
from ..six import b, bytes_to_str, MAXSIZE

METHOD_RE = re.compile("^[A-Z0-9$-_.]{1,20}$")
VERSION_RE = re.compile("^HTTP/(\d+).(\d+)$")
STATUS_RE = re.compile("^(\d{3})(?:\s+(\w*))?$")
HEADER_RE = re.compile("[\x00-\x1F\x7F()<>@,;:\[\]={} \t\\\\\"]")

# errors
BAD_FIRST_LINE = 0
INVALID_HEADER = 1
INVALID_CHUNK = 2


class InvalidRequestLine(Exception):
    """ error raised when first line is invalid """


class InvalidHeader(Exception):
    """ error raised on invalid header """


class InvalidChunkSize(Exception):
    """ error raised when we parse an invalid chunk size """
<commit_msg>add missing / to the invalid http header field regex definition<commit_after># -*- coding: utf-8 -
#
# This file is part of http-parser released under the MIT license.
# See the NOTICE for more information.

import os
import re
import zlib

try:
    import urlparse
    from urllib import unquote
except ImportError:
    import urllib.parse as urlparse  # NOQA
    from urllib.parse import unquote  # NOQA

from .headers import Headers
from ..six import b, bytes_to_str, MAXSIZE

METHOD_RE = re.compile("^[A-Z0-9$-_.]{1,20}$")
VERSION_RE = re.compile("^HTTP/(\d+).(\d+)$")
STATUS_RE = re.compile("^(\d{3})(?:\s+(\w*))?$")
HEADER_RE = re.compile("[\x00-\x1F\x7F()<>@,;:/\[\]={} \t\\\\\"]")

# errors
BAD_FIRST_LINE = 0
INVALID_HEADER = 1
INVALID_CHUNK = 2


class InvalidRequestLine(Exception):
    """ error raised when first line is invalid """


class InvalidHeader(Exception):
    """ error raised on invalid header """


class InvalidChunkSize(Exception):
    """ error raised when we parse an invalid chunk size """

{'fraction_non_alphanumeric': 0.15369161225514816, 'fraction_numerical': 0.014063284781516826, 'mean_word_length': 3.846715328467153, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2190374', 'n_tokens_mistral': 684, 'n_tokens_neox': 656, 'n_words': 205}