<commit_before>from fabric import api

api.env.hosts = ['172.16.58.3']
api.env.user = 'deploy'
api.env.directory = "$HOME/sites/ownblock/ownblock"
api.env.activate = "source $HOME/.virtualenvs/ownblock/bin/activate"


def manage(cmd):
    return api.run("dotenv %s/manage.py %s" % (api.env.directory, cmd))


@api.task
def bower_update():

    with api.cd(api.env.directory):
        api.run("bower update")
        with api.cd(api.env.directory +
                    "/static/bower_components/openlayers/build"):

            api.run("python build.py")
            api.run("ln -s ../img .")
            api.run("ln -s ../theme .")


@api.task
def deploy():
    with api.cd(api.env.directory):

        api.run("git pull")

        with api.prefix(api.env.activate):

            api.run("pip install -r ../requirements/production.txt")

            manage("check")
            manage("collectstatic --noinput")
            manage("migrate")

    bower_update()
    api.sudo("supervisorctl restart webapp")<commit_msg>Bower changes<commit_after>from fabric import api

api.env.hosts = ['172.16.58.3']
api.env.user = 'deploy'
api.env.directory = "$HOME/sites/ownblock/ownblock"
api.env.activate = "source $HOME/.virtualenvs/ownblock/bin/activate"


def manage(cmd):
    return api.run("dotenv %s/manage.py %s" % (api.env.directory, cmd))


@api.task
def bower_update():

    with api.cd(api.env.directory):
        api.run("bower update")
        with api.cd(api.env.directory +
                    "/static/bower_components/openlayers/build"):

            api.run("python build.py")
            api.run("ln -s ../img .")
            api.run("ln -s ../theme .")

        with api.prefix(api.env.activate):
            manage("collectstatic --noinput")


@api.task
def deploy():
    with api.cd(api.env.directory):

        api.run("git pull")

        with api.prefix(api.env.activate):

            api.run("pip install -r ../requirements/production.txt")

            manage("check")
            manage("collectstatic --noinput")
            manage("migrate")

    api.sudo("supervisorctl restart webapp")
{'fraction_non_alphanumeric': 0.16136687233032748, 'fraction_numerical': 0.007593735168485999, 'mean_word_length': 2.3092621664050235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5353215', 'n_tokens_mistral': 712, 'n_tokens_neox': 666, 'n_words': 123}