<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#config.py for Config File in /home/loic/GitHub/Moustash/moustash
#
#Made by <NAME>, Findsp<EMAIL>
#Login   <<EMAIL>>
#
#

import ConfigParser
import redis
from utils import config_section_map

class Franck:
    def __init__(self, config_file):
        self.config = ConfigParser.ConfigParser()
        self.config.read(config_file)
        self.moustash_config = {}
        self.moustash_config["Moustash"] = config_section_map(self.config, "Moustash")
        self.moustash_config["Cuir"] = config_section_map(self.config, "Cuir")
        if self.moustash_config["Moustash"]["transport"] == "redis":
            self.broker = self.connect_to_redis()
            redis_namespace = "moustash"
            if "redis_namespace" in self.moustash_config["Moustash"]:
                redis_namespace = self.moustash_config["Moustash"]["redis_namespace"]
            self.broker_namespace = redis_namespace
        else:
            print("Not yet implemented : %s !" % moustash_config["Moustash"]["transport"])
    
    def connect_to_redis(self):
        redis_ip = "127.0.0.1"
        redis_port = "6379"
        redis_db = "0"<commit_msg>Add base rabbitmq in the transporter<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#config.py for Config File in /home/loic/GitHub/Moustash/moustash
#
#Made by <NAME>, <EMAIL>
#Login   <<EMAIL>>
#
#

import ConfigParser
import redis
from utils import config_section_map

class Franck:
    def __init__(self, config_file):
        self.config = ConfigParser.ConfigParser()
        self.config.read(config_file)
        self.moustash_config = {}
        self.moustash_config["Moustash"] = config_section_map(self.config, "Moustash")
        self.moustash_config["Cuir"] = config_section_map(self.config, "Cuir")
        if self.moustash_config["Moustash"]["transport"] == "redis":
            self.broker = self.connect_to_redis()
            redis_namespace = "moustash"
            if "redis_namespace" in self.moustash_config["Moustash"]:
                redis_namespace = self.moustash_config["Moustash"]["redis_namespace"]
            self.broker_namespace = redis_namespace
        else if self.moustash_config["Moustash"]["transport"] == "rabbitmq":
            self.broker = {}
            rabbitmq_parameters = {"rabbitmq_host" : "localhost", "rabbitmq_port": "5672", "rabbitmq_ssl" : "0", "rabbitmq_ssl_key" = None, 
                                   "rabbitmq_ssl_cert" = None, "rabbitmq_ssl_cacert" = None, "rabbitmq_vhost" = "/", "rabbitmq_username" = "guest",
                                   "rabbitmq_password" = "<PASSWORD>", "rabbitmq_queue" = "logstash-queue", "rabbitmq_queue_durable" = "0",
                                   "rabbitmq_exchange_type" = "direct", "rabbitmq_exchange_durable" = "0", "rabbitmq_key" = "logstash-key",
                                   "rabbitmq_exchange" = "logstash-exchange"}
            for rabbitmq_options, rabbitmq_options_value in rabbitmq_parameters.iteritems():
                if rabbitmq_options in self.moustash_config["Moustash"]:
                    self.broker[rabbitmq_options] = self.moustash_config["Moustash"][rabbitmq_options]
                else:
                    self.broker[rabbitmq_options] = rabbitmq_options_value
        else:
            print("Not yet implemented : %s !" % moustash_config["Moustash"]["transport"])
    
    def connect_to_redis(self):
        redis_ip = "127.0.0.1"
        redis_port = "6379"
        redis_db = "0"
{'fraction_non_alphanumeric': 0.12606232294617564, 'fraction_numerical': 0.008781869688385268, 'mean_word_length': 2.78862660944206, 'pattern_counts': {'":': 4, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4404565', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1135, 'n_words': 189}