<commit_before>#!/usr/bin/env python
import os
from fabric.api import env, abort, require, settings, runs_once, prompt, get
from fabric.contrib.console import confirm
from fab_shared import (_find_unit_root, _development, _production, _localhost,
        _clone, _make_release, TIME_NOW, _make_archive,
        _conditional_upload_to_s3, _upload_to_s3, S3_KEY, local, put, run, sudo,
        EC2_CONNECTION, ELB_CONNECTION)
import time

env.unit = "chef"
env.user_data = "deployment/chef.user-data"
env.scm = "<EMAIL>:bueda/chef"
env.root_dir = _find_unit_root(os.path.abspath(os.path.dirname(__file__)))

env.scratch_path = '/tmp/%s-%s' % (env.unit, TIME_NOW)

def development():
    """
    [Env] Sets environment for development server.
    """
    _development()
    env.tagged = False
    env.security_groups = ["development", "ssh", "database-client"]
    env.key_name = "development"
    env.chef_configs = ["common", "common-web", "dev", "lda"]

def production():
    """
    [Env] Sets environment for production servers behind load balancer.
    """
    _production()
    env.tagged = False
    env.security_groups = ["production", "ssh", "database-client"]
    env.key_name = "production"
    env.chef_configs = ["common", "common-web", "production"]

def localhost():
    """
    [Env] Sets environment for this machine, without using SSH.
    """
    _localhost()
    env.tagged = False
    env.chef_configs = ["common", "common-web", "dev", "lda"]

def deploy(release=None):
    """
    Deploy a specific commit, tag or HEAD to all servers and/or S3.
    """<commit_msg>Require localhost deployment to set environment<commit_after>#!/usr/bin/env python
import os
from fabric.api import env, abort, require, settings, runs_once, prompt, get
from fabric.contrib.console import confirm
from fab_shared import (_find_unit_root, _development, _production,
        _clone, _make_release, TIME_NOW, _make_archive,
        _conditional_upload_to_s3, _upload_to_s3, S3_KEY, local, put, run, sudo,
        EC2_CONNECTION, ELB_CONNECTION)
import time

env.unit = "chef"
env.user_data = "deployment/chef.user-data"
env.scm = "<EMAIL>:bueda/chef"
env.root_dir = _find_unit_root(os.path.abspath(os.path.dirname(__file__)))

env.scratch_path = '/tmp/%s-%s' % (env.unit, TIME_NOW)

def development():
    """
    [Env] Sets environment for development server.
    """
    _development()
    env.tagged = False
    env.security_groups = ["development", "ssh", "database-client"]
    env.key_name = "development"
    env.chef_configs = ["common", "common-web", "dev", "lda"]

def production():
    """
    [Env] Sets environment for production servers behind load balancer.
    """
    _production()
    env.tagged = False
    env.security_groups = ["production", "ssh", "database-client"]
    env.key_name = "production"
    env.chef_configs = ["common", "common-web", "production"]

def deploy(release=None):
    """
    Deploy a specific commit, tag or HEAD to all servers and/or S3.
    """
{'fraction_non_alphanumeric': 0.13645484949832776, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 3.927512355848435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3977220', 'n_tokens_mistral': 1008, 'n_tokens_neox': 975, 'n_words': 247}