<commit_before>from fabric.decorators import task
from fabric.context_managers import settings
from fabric.api import require, env, local, abort, run as frun
from fabric.contrib.console import confirm
from fabric.colors import green, red



@task
def run():
    """
    Run development server
    """
    do('venv/bin/python3 run.py')


@task
def build():
    """
    Build basic application
    """
    do('[ -d venv ] || virtualenv venv --no-site-packages --python=python3')
    do('venv/bin/pip install --upgrade -r requirements.txt')
    do('venv/bin/python3 -c "from models import db; db.create_all()"')


def do(*args):
    """
    Runs command locally or remotely depending on whether a remote host has
    been specified and ask about continue on fail.
    """
    with settings(warn_only=True):
        if env.host_string:
            with settings(cd(config.remote_path)):
                result = frun(*args, capture=False)
        else:
            result = local(*args, capture=False)

    if result.failed:
        if result.stderr:
            print(red(result.stderr))
        if not confirm("Continue anyway?"):
            abort('Stopped execution per user request.')
<commit_msg>project: (fix) fab build [need lazy import?]<commit_after>from fabric.decorators import task
from fabric.context_managers import settings
from fabric.api import require, env, local, abort, run as frun
from fabric.contrib.console import confirm
from fabric.colors import green, red



@task
def run():
    """
    Run development server
    """
    do('venv/bin/python3 run.py')


@task
def build():
    """
    Build basic application
    """
    do('[ -d venv ] || virtualenv venv --no-site-packages --python=python3')
    do('venv/bin/pip install --upgrade -r requirements.txt')
    do('venv/bin/python3 -c "from app import app;from models import db; db.create_all()"')


def do(*args):
    """
    Runs command locally or remotely depending on whether a remote host has
    been specified and ask about continue on fail.
    """
    with settings(warn_only=True):
        if env.host_string:
            with settings(cd(config.remote_path)):
                result = frun(*args, capture=False)
        else:
            result = local(*args, capture=False)

    if result.failed:
        if result.stderr:
            print(red(result.stderr))
        if not confirm("Continue anyway?"):
            abort('Stopped execution per user request.')

{'fraction_non_alphanumeric': 0.11401716387413159, 'fraction_numerical': 0.002451982018798529, 'mean_word_length': 2.766153846153846, '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': '3766454', 'n_tokens_mistral': 707, 'n_tokens_neox': 686, 'n_words': 227}