<commit_before>"""Juju GUI charm utilities."""

__all__ = [
    'AGENT',
    'API_PORT',
    'bzr_checkout',
    'cmd_log',
    'CURRENT_DIR',
    'fetch_api',
    'fetch_gui',
    'first_path_in_dir',
    'get_release_file_url',
    'get_staging_dependencies',
    'get_zookeeper_address',
    'HAPROXY',
    'IMPROV',
    'JUJU_DIR',
    'JUJU_GUI_DIR',
    'JUJU_GUI_SITE',
    'JUJU_PEM',
    'log_hook',
    'NGINX',
    'parse_source',
    'render_to_file',
    'save_or_create_certificates',
    'setup_gui',
    'setup_nginx',
    'start_agent',
    'start_gui',
    'start_improv',
    'stop',
    'WEB_PORT',
]

from contextlib import contextmanager
import json
import os
import logging
import shutil
from subprocess import CalledProcessError
import tempfile
import tempita

from launchpadlib.launchpad import Launchpad
from shelltoolbox import (
    apt_get_install,
    command,
    environ,
    install_extra_repositories,
    run,
    script_name,
    search_file,
    Serializer,
    su,
)
from charmhelpers import (
    get_config,
    log,
    service_control,
    START,
    STOP,
    unit_get,
)


AGENT = 'juju-api-agent'
IMPROV = 'juju-api-improv'
HAPROXY = 'haproxy'
NGINX = 'nginx'

API_PORT = 8080
WEB_PORT = 8000

CURRENT_DIR = os.getcwd()
JUJU_DIR = os.path.join(CURRENT_DIR, 'juju')
JUJU_GUI_DIR = os.path.join(CURRENT_DIR, 'juju-gui')
JUJU_GUI_SITE = '/etc/nginx/sites-available/juju-gui'
JUJU_PEM = 'juju.includes-private-key.pem'
BUILD_REPOSITORIES = ('ppa:chris-lea/node.js',)
DEB_BUILD_DEPENDENCIES = (
    'bzr', 'imagemagick', 'make',  'nodejs',
)
DEB_STAGE_DEPENDENCIES = (
    'zookeeper',
)

<commit_msg>reverting to legacy ppa for node<commit_after>"""Juju GUI charm utilities."""

__all__ = [
    'AGENT',
    'API_PORT',
    'bzr_checkout',
    'cmd_log',
    'CURRENT_DIR',
    'fetch_api',
    'fetch_gui',
    'first_path_in_dir',
    'get_release_file_url',
    'get_staging_dependencies',
    'get_zookeeper_address',
    'HAPROXY',
    'IMPROV',
    'JUJU_DIR',
    'JUJU_GUI_DIR',
    'JUJU_GUI_SITE',
    'JUJU_PEM',
    'log_hook',
    'NGINX',
    'parse_source',
    'render_to_file',
    'save_or_create_certificates',
    'setup_gui',
    'setup_nginx',
    'start_agent',
    'start_gui',
    'start_improv',
    'stop',
    'WEB_PORT',
]

from contextlib import contextmanager
import json
import os
import logging
import shutil
from subprocess import CalledProcessError
import tempfile
import tempita

from launchpadlib.launchpad import Launchpad
from shelltoolbox import (
    apt_get_install,
    command,
    environ,
    install_extra_repositories,
    run,
    script_name,
    search_file,
    Serializer,
    su,
)
from charmhelpers import (
    get_config,
    log,
    service_control,
    START,
    STOP,
    unit_get,
)


AGENT = 'juju-api-agent'
IMPROV = 'juju-api-improv'
HAPROXY = 'haproxy'
NGINX = 'nginx'

API_PORT = 8080
WEB_PORT = 8000

CURRENT_DIR = os.getcwd()
JUJU_DIR = os.path.join(CURRENT_DIR, 'juju')
JUJU_GUI_DIR = os.path.join(CURRENT_DIR, 'juju-gui')
JUJU_GUI_SITE = '/etc/nginx/sites-available/juju-gui'
JUJU_PEM = 'juju.includes-private-key.pem'
#BUILD_REPOSITORIES = ('ppa:chris-lea/node.js',)
BUILD_REPOSITORIES = ('ppa:chris-lea/node.js-legacy',)
DEB_BUILD_DEPENDENCIES = (
    'bzr', 'imagemagick', 'make',  'nodejs', 'npm',
)
DEB_STAGE_DEPENDENCIES = (
    'zookeeper',
)


{'fraction_non_alphanumeric': 0.12693222354340072, 'fraction_numerical': 0.0047562425683709865, 'mean_word_length': 3.6477900552486187, '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': '862501', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1388, 'n_words': 232}