<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import code
import platform
import subprocess
import logging

from invoke import task, run
from invoke.exceptions import Failure

from website import settings
from website.app import init_app

logging.getLogger('invoke').setLevel(logging.CRITICAL)

def get_bin_path():
    """Get parent path of current python binary.
    """
    return os.path.dirname(sys.executable)


def bin_prefix(cmd):
    """Prefix command with current binary path.
    """
    return os.path.join(get_bin_path(), cmd)


try:
    run('pip freeze | grep rednose', hide='both')
    TEST_CMD = 'nosetests --rednose'
except Failure:
    TEST_CMD = 'nosetests'


@task
def server(host=None, port=5000, debug=True):
    """Run the app server."""
    app = init_app(set_backends=True, routes=True)
    app.run(host=host, port=port, debug=debug)


SHELL_BANNER = """
{version}

+--------------------------------------------------+
|cccccccccccccccccccccccccccccccccccccccccccccccccc|
|ccccccccccccccccccccccOOOOOOOccccccccccccccccccccc|
|ccccccccccccccccccccOOOOOOOOOOcccccccccccccccccccc|
|cccccccccccccccccccOOOOOOOOOOOOccccccccccccccccccc|
|cccccccccOOOOOOOcccOOOOOOOOOOOOcccOOOOOOOccccccccc|
|cccccccOOOOOOOOOOccOOOOOsssOOOOcOOOOOOOOOOOccccccc|<commit_msg>Fix invoke tasks<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import code
import platform
import subprocess
import logging

from invoke import task, run
from invoke.exceptions import Failure

from website import settings

logging.getLogger('invoke').setLevel(logging.CRITICAL)

def get_bin_path():
    """Get parent path of current python binary.
    """
    return os.path.dirname(sys.executable)


def bin_prefix(cmd):
    """Prefix command with current binary path.
    """
    return os.path.join(get_bin_path(), cmd)


try:
    run('pip freeze | grep rednose', hide='both')
    TEST_CMD = 'nosetests --rednose'
except Failure:
    TEST_CMD = 'nosetests'


@task
def server(host=None, port=5000, debug=True):
    """Run the app server."""
    from website.app import init_app
    app = init_app(set_backends=True, routes=True)
    app.run(host=host, port=port, debug=debug)


SHELL_BANNER = """
{version}

+--------------------------------------------------+
|cccccccccccccccccccccccccccccccccccccccccccccccccc|
|ccccccccccccccccccccccOOOOOOOccccccccccccccccccccc|
|ccccccccccccccccccccOOOOOOOOOOcccccccccccccccccccc|
|cccccccccccccccccccOOOOOOOOOOOOccccccccccccccccccc|
|cccccccccOOOOOOOcccOOOOOOOOOOOOcccOOOOOOOccccccccc|
|cccccccOOOOOOOOOOccOOOOOsssOOOOcOOOOOOOOOOOccccccc|
{'fraction_non_alphanumeric': 0.1436077057793345, 'fraction_numerical': 0.0035026269702276708, 'mean_word_length': 4.338317757009346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 38, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3965865', 'n_tokens_mistral': 964, 'n_tokens_neox': 928, 'n_words': 221}