<commit_before>"""
Fabric's own fabfile.
"""

from __future__ import with_statement

from fabric.api import *
from fabric.contrib.project import rsync_project
# Need to import this as fabric.version for reload() purposes
import fabric.version
# But nothing is stopping us from making a convenient binding!
_version = fabric.version.get_version


def test(args=""):
    """
    Run all unit tests and doctests.

    Specify string argument ``args`` for additional args to ``nosetests``.
    """
    print(local('nosetests -sv --with-doctest %s' % args, capture=False))


def build_docs(clean='no', browse='no'):
    """
    Generate the Sphinx documentation.
    """
    c = ""
    if clean.lower() in ['yes', 'y']:
        c = "clean "
    b = ""
    if browse.lower() in ['yes', 'y']:
        b = " && open _build/html/index.html"
    local('cd docs; make %shtml%s' % (c, b), capture=False)


@hosts('<EMAIL>')
def push_docs():
    """
    Build and push the Sphinx docs to docs.fabfile.org
    """
    build_docs()
    branch = _version('branch')
    remote_loc = '/var/www/docs.fabfile/%s/' % branch
    rsync_project(remote_loc, 'docs/_build/html/', delete=True)


def _code_version_is_tagged():
    return local('git tag | egrep "^%s$"' % _version('short'))

def _update_code_version():
    """
    Update version data structure in-code and commit that change to git.
    """
    raw_input("Work has been done since last tag, version update is needed. Hit Enter to load version info in your editor: ")<commit_msg>Switch docs URLs to use shortversion, not branch<commit_after>"""
Fabric's own fabfile.
"""

from __future__ import with_statement

from fabric.api import *
from fabric.contrib.project import rsync_project
# Need to import this as fabric.version for reload() purposes
import fabric.version
# But nothing is stopping us from making a convenient binding!
_version = fabric.version.get_version


def test(args=""):
    """
    Run all unit tests and doctests.

    Specify string argument ``args`` for additional args to ``nosetests``.
    """
    print(local('nosetests -sv --with-doctest %s' % args, capture=False))


def build_docs(clean='no', browse='no'):
    """
    Generate the Sphinx documentation.
    """
    c = ""
    if clean.lower() in ['yes', 'y']:
        c = "clean "
    b = ""
    if browse.lower() in ['yes', 'y']:
        b = " && open _build/html/index.html"
    local('cd docs; make %shtml%s' % (c, b), capture=False)


@hosts('<EMAIL>')
def push_docs():
    """
    Build and push the Sphinx docs to docs.fabfile.org
    """
    build_docs(clean='yes')
    remote_loc = '/var/www/docs.fabfile/%s/' % _version('short')
    rsync_project(remote_loc, 'docs/_build/html/', delete=True)


def _code_version_is_tagged():
    return local('git tag | egrep "^%s$"' % _version('short'))

def _update_code_version():
    """
    Update version data structure in-code and commit that change to git.
    """
    raw_input("Work has been done since last tag, version update is needed. Hit Enter to load version info in your editor: ")
{'fraction_non_alphanumeric': 0.1394968964390722, 'fraction_numerical': 0.0, 'mean_word_length': 3.444121915820029, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '699953', 'n_tokens_mistral': 987, 'n_tokens_neox': 948, 'n_words': 311}