<commit_before>import time

import pyparsing as pp

from . import base, http, websockets, writer, exceptions

from exceptions import *
from base import Settings


def parse_response(s):
    """
        May raise ParseException
    """
    try:
        s = s.decode("ascii")
    except UnicodeError:
        raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
    try:
        return http.Response.expr().parseString(s, parseAll=True)[0]
    except pp.ParseException as v:
        raise exceptions.ParseException(v.msg, v.line, v.col)


def parse_requests(s):
    """
        May raise ParseException
    """
    try:
        s = s.decode("ascii")
    except UnicodeError:
        raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
    try:
        reqs = pp.OneOrMore(
            pp.Or(
                [
                    websockets.WebsocketFrame.expr(),<commit_msg>Prevent autoflake from changing our API<commit_after>import time

import pyparsing as pp

from . import base, http, websockets, writer, exceptions

from exceptions import *
from base import Settings
assert Settings  # prevent pyflakes from messing with this


def parse_response(s):
    """
        May raise ParseException
    """
    try:
        s = s.decode("ascii")
    except UnicodeError:
        raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
    try:
        return http.Response.expr().parseString(s, parseAll=True)[0]
    except pp.ParseException as v:
        raise exceptions.ParseException(v.msg, v.line, v.col)


def parse_requests(s):
    """
        May raise ParseException
    """
    try:
        s = s.decode("ascii")
    except UnicodeError:
        raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
    try:
        reqs = pp.OneOrMore(
            pp.Or(
                [
                    websockets.WebsocketFrame.expr(),
{'fraction_non_alphanumeric': 0.09899417681312864, 'fraction_numerical': 0.005293806246691371, 'mean_word_length': 2.375, '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': '752618', 'n_tokens_mistral': 562, 'n_tokens_neox': 530, 'n_words': 158}