<commit_before>#!/bin/bash

set -e
set -x

install_wsproto() {
    pip install -U pip setuptools
    python setup.py sdist
    pip install dist/*
    if [ $WSACCEL -eq 1 ]; then
        pip install wsaccel
    fi
}

case "$MODE" in
    flake8)
        pip install flake8
        flake8 --max-complexity 10 wsproto
        ;;

    docs)
        # For autodoc
        install_wsproto
        pip install sphinx
        sphinx-build -nW -b html -d docs/build/doctrees docs/source docs/build/html
        ;;
    pytest)
        install_wsproto
        pip install -r test_requirements.txt

        # Prevent python from seeing our source tree, forcing it to use the
        # installed version
        mkdir empty
        cd empty/
<commit_msg>We should almost certainly try to refactor to reduce complexity but oh well.<commit_after>#!/bin/bash

set -e
set -x

install_wsproto() {
    pip install -U pip setuptools
    python setup.py sdist
    pip install dist/*
    if [ $WSACCEL -eq 1 ]; then
        pip install wsaccel
    fi
}

case "$MODE" in
    flake8)
        pip install flake8
        flake8 --max-complexity 20 wsproto
        ;;

    docs)
        # For autodoc
        install_wsproto
        pip install sphinx
        sphinx-build -nW -b html -d docs/build/doctrees docs/source docs/build/html
        ;;
    pytest)
        install_wsproto
        pip install -r test_requirements.txt

        # Prevent python from seeing our source tree, forcing it to use the
        # installed version
        mkdir empty
        cd empty/

{'fraction_non_alphanumeric': 0.06675307841866494, 'fraction_numerical': 0.007777057679844459, 'mean_word_length': 1.838235294117647, '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': '4841849', 'n_tokens_mistral': 502, 'n_tokens_neox': 465, 'n_words': 164}