<commit_before>from fabric.api import run, sudo
from fabric.contrib.files import append

from fab_deploy2.base import servers as base_servers


class JoyentMixin(object):

    def _set_profile(self):
        append('/etc/profile', 'CC="gcc -m64"; export CC', use_sudo=True)
        append('/etc/profile', 'LDSHARED="gcc -m64 -G"; export LDSHARED', use_sudo=True)

    def _ssh_restart(self):
        run('svcadm restart ssh')

class AppMixin(JoyentMixin):
    packages = ['gcc47', 'python27', 'py27-psycopg2', 'py27-setuptools',
                'py27-imaging', 'py27-expat']

    def _set_profile(self):
        JoyentMixin._set_profile(self)
        base_servers.AppServer._set_profile(self)

    def _install_packages(self):
        for package in self.packages:
            sudo('pkg_add %s' % package)
        sudo('easy_install-2.7 pip')


class LBServer(JoyentMixin,  base_servers.LBServer):<commit_msg>Python already installed on joyent now<commit_after>from fabric.api import run, sudo
from fabric.contrib.files import append

from fab_deploy2.base import servers as base_servers


class JoyentMixin(object):

    def _set_profile(self):
        append('/etc/profile', 'CC="gcc -m64"; export CC', use_sudo=True)
        append('/etc/profile', 'LDSHARED="gcc -m64 -G"; export LDSHARED', use_sudo=True)

    def _ssh_restart(self):
        run('svcadm restart ssh')

class AppMixin(JoyentMixin):
    packages = ['gcc47', 'py27-psycopg2', 'py27-setuptools',
                'py27-imaging', 'py27-expat']

    def _set_profile(self):
        JoyentMixin._set_profile(self)
        base_servers.AppServer._set_profile(self)

    def _install_packages(self):
        for package in self.packages:
            sudo('pkg_add %s' % package)
        sudo('easy_install-2.7 pip')


class LBServer(JoyentMixin,  base_servers.LBServer):
{'fraction_non_alphanumeric': 0.12179137083560895, 'fraction_numerical': 0.02075368651010377, 'mean_word_length': 3.4792176039119806, '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': '2463091', 'n_tokens_mistral': 665, 'n_tokens_neox': 606, 'n_words': 131}