<commit_before>#!/usr/bin/env python2.7

import ConfigParser
import sys

from subprocess import check_output

def url(service, service_type):
    url_str = "not running"
    locally-active = []
    try:
        config = ConfigParser.RawConfigParser()
        config.read("/var/lib/docker/data/templates/core.template")
        # Check if section exists in config, and if there are any options
        if config.has_section("locally-active") and config.options("locally-active"):
            locally_active = config.options("locally-active")
        local_off_set = False
        for s in locally_active:
            if s == service:
                local_off_set = True
        local_off = None
        if local_off_set:
            local_off = config.get("locally-active", service)
        if local_off == "off":
            external_host = config.get("external", service+"_host")
            if service == "elasticsearch":
                if service_type == "head":
                    url_str = "http://"+external_host+":9200/_plugin/head"
                elif service_type == "marvel":
                    url_str = "http://"+external_host+":9200/_plugin/marvel"
            elif service == "aaa-rabbitmq":
                url_str = "http://"+external_host+":15672 login: guest/guest"
            elif service == "aaa-syslog":
                # !! TODO
                url_str = "external"
                pass
        else:
            if service == "elasticsearch":
                if service_type == "head":
                    url_str = check_output("/data/service_urls/get_elasticsearch_head_url.sh")<commit_msg>Minor error with '-' instead of '_'<commit_after>#!/usr/bin/env python2.7

import ConfigParser
import sys

from subprocess import check_output

def url(service, service_type):
    url_str = "not running"
    locally_active = []
    try:
        config = ConfigParser.RawConfigParser()
        config.read("/var/lib/docker/data/templates/core.template")
        # Check if section exists in config, and if there are any options
        if config.has_section("locally-active") and config.options("locally-active"):
            locally_active = config.options("locally-active")
        local_off_set = False
        for s in locally_active:
            if s == service:
                local_off_set = True
        local_off = None
        if local_off_set:
            local_off = config.get("locally-active", service)
        if local_off == "off":
            external_host = config.get("external", service+"_host")
            if service == "elasticsearch":
                if service_type == "head":
                    url_str = "http://"+external_host+":9200/_plugin/head"
                elif service_type == "marvel":
                    url_str = "http://"+external_host+":9200/_plugin/marvel"
            elif service == "aaa-rabbitmq":
                url_str = "http://"+external_host+":15672 login: guest/guest"
            elif service == "aaa-syslog":
                # !! TODO
                url_str = "external"
                pass
        else:
            if service == "elasticsearch":
                if service_type == "head":
                    url_str = check_output("/data/service_urls/get_elasticsearch_head_url.sh")
{'fraction_non_alphanumeric': 0.11274509803921569, 'fraction_numerical': 0.009191176470588236, 'mean_word_length': 1.9817351598173516, 'pattern_counts': {'":': 22, '<': 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': '3709813', 'n_tokens_mistral': 922, 'n_tokens_neox': 889, 'n_words': 202}