<commit_before># coding=utf-8

# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of fabric_navitia, the provisioning and deployment tool
#     of Navitia, the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
#     powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
#     a non ending quest to the responsive locomotion way of traveling!
#
# LICENCE: This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Stay tuned using
# twitter @navitia
# IRC #navitia on freenode
# https://groups.google.com/d/forum/navitia
# www.navitia.io

from fabric.api import env
from fabric.decorators import task
from fabric.colors import yellow
import re
import os
from importlib import import_module
from fabric.operations import run

env.distrib = 'ubuntu14.04'
env.KRAKEN_USER = 'www-data'
env.TYR_USER = env.KRAKEN_USER

# local path to navitia packages
env.debian_packages_path = None

env.use_systemd = False


def service_path():
    """
    Use an adapted service path according to the OS
    """
    if env.use_systemd:
        return '/etc/systemd/system/'
    else:
        return '/etc/init.d/'
env.service_path = service_path


def service_name(service):
    """
    Use an adapted service name with the path according to the OS
    """
    if env.use_systemd:
        return env.service_path() + service + '.service'
    else:
        return env.service_path() + service
env.service_name = service_name

env.default_ssh_user = 'root'


def make_ssh_url(serv, *args):
    """
    given an url, returns user@url
    will return a list [user@url1, user@url2, ...] if serv is iterable
    or if more than one argument is given
    """
    if args:
        serv = [serv]
        serv.extend(args)
    elif isinstance(serv, basestring):
        return "{}@{}".format(env.default_ssh_user, serv)
    return ["{}@{}".format(env.default_ssh_user, s) for s in serv]
env.make_ssh_url = make_ssh_url

env.KRAKEN_RABBITMQ_OK_PORT = 5672
env.KRAKEN_RABBITMQ_WRONG_PORT = 56722
env.PUPPET_RESTART_DELAY = 30
# max time (in s) that a kraken can take to restart
env.KRAKEN_RESTART_DELAY = 90<commit_msg>make env.make_ssh_url recursive<commit_after># coding=utf-8

# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of fabric_navitia, the provisioning and deployment tool
#     of Navitia, the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
#     powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
#     a non ending quest to the responsive locomotion way of traveling!
#
# LICENCE: This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Stay tuned using
# twitter @navitia
# IRC #navitia on freenode
# https://groups.google.com/d/forum/navitia
# www.navitia.io

from fabric.api import env
from fabric.decorators import task
from fabric.colors import yellow
import re
import os
from importlib import import_module
from fabric.operations import run

env.distrib = 'ubuntu14.04'
env.KRAKEN_USER = 'www-data'
env.TYR_USER = env.KRAKEN_USER

# local path to navitia packages
env.debian_packages_path = None

env.use_systemd = False


def service_path():
    """
    Use an adapted service path according to the OS
    """
    if env.use_systemd:
        return '/etc/systemd/system/'
    else:
        return '/etc/init.d/'
env.service_path = service_path


def service_name(service):
    """
    Use an adapted service name with the path according to the OS
    """
    if env.use_systemd:
        return env.service_path() + service + '.service'
    else:
        return env.service_path() + service
env.service_name = service_name

env.default_ssh_user = 'root'


def make_ssh_url(serv, *args):
    """
    given an url, returns user@url
    will return a list [user@url1, user@url2, ...] if serv is iterable
    or if more than one argument is given
    """
    if args:
        serv = [serv]
        serv.extend(args)
    elif isinstance(serv, basestring):
        return "{}@{}".format(env.default_ssh_user, serv)
    return [make_ssh_url(s) for s in serv]
env.make_ssh_url = make_ssh_url

env.KRAKEN_RABBITMQ_OK_PORT = 5672
env.KRAKEN_RABBITMQ_WRONG_PORT = 56722
env.PUPPET_RESTART_DELAY = 30
# max time (in s) that a kraken can take to restart
env.KRAKEN_RESTART_DELAY = 90
{'fraction_non_alphanumeric': 0.08292079207920793, 'fraction_numerical': 0.010254596888260255, 'mean_word_length': 3.633087633087633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 8, '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': '4502181', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1714, 'n_words': 666}