<commit_before>#!/usr/bin/python

import argparse
import commands
import logging
import os
import random
import signal
import sys
import thread
import time

from apscheduler.scheduler import Scheduler
from apscheduler.threadpool import ThreadPool

from core.irlp import Irlp
from core.voicesynthetizer import VoiceSynthetizer

# Production

from modules.alive import Alive
from modules.aprstracker import AprsTracker
from modules.aprstt import Aprstt
from modules.clock import Clock
from modules.identification import Identification
from modules.selfie import Selfie
from modules.voicecommand import VoiceCommand
from modules.weather import Weather
from modules.wolframalpha import WolframAlpha

# Experimental

from modules.assistant import Assistant
from modules.messages import Messages
from modules.meteorology import Meteorology
from learning.morseteacher import MorseTeacher
from modules.news import News
from modules.seismology import Seismology
from modules.voicemail import VoiceMail
from modules.voiceexperimental import VoiceExperimental

class Cancun(object):

    def __init__(self, voicesynthetizer, irlp):

        self.irlp = irlp
        self.voicesynthetizer = voicesynthetizer
        self.pidfile = None
        self.scheduler_status = False
        self.pidfile = "/tmp/cancun.pid"

    def __del__(self):
        pass

    def modules_setup(self):

        # Production Modules
        self.alive = Alive()
        self.aprstracker = AprsTracker(self.voicesynthetizer)
        self.aprstt = Aprstt(self.voicesynthetizer)
        self.clock = Clock(self.voicesynthetizer)
        self.identification = Identification(self.voicesynthetizer)
        self.selfie = Selfie(self.voicesynthetizer)
        self.voicecommand = VoiceCommand(self.voicesynthetizer)
        self.weather = Weather(self.voicesynthetizer)
        self.wolframalpha = WolframAlpha(self.voicesynthetizer)

        # Experimental Modules
        self.assistant = Assistant(self.voicesynthetizer)
        self.messages = Messages(self.voicesynthetizer)
        self.meteorology = Meteorology(self.voicesynthetizer)
        self.morseteacher = MorseTeacher(self.voicesynthetizer)
        self.news = News(self.voicesynthetizer)
        self.seismology = Seismology(self.voicesynthetizer)
        self.voicemail = VoiceMail(self.voicesynthetizer)
        self.voiceexperimental = VoiceExperimental(self.voicesynthetizer)

    def dtmf_setup(self,dtmf):
        dtmf_codes = {
        'PS0': 'alive',
        'PS1': 'aprstracker',
        'PS2': 'news',
        'PS3': 'meteorology'
        'PS4': 'selfie',
        'PS5': 'voicecommand',
        'PS6': 'wolframalpha',
        'PS7': 'voiceexperimental'
        }
        return dtmf_codes.get(dtmf)

    def enabled(self):
        return os.path.isfile(self.pidfile)

    def enable(self):

        pid = str(os.getpid())
        file(self.pidfile, 'w').write(pid)

    def disable(self):

        if self.enabled():
            os.unlink(self.pidfile)
        if self.scheduler_status:
            self.scheduler.shutdown()

    def scheduler_mode(self):

        logging.info('Mode Scheduler')
        self.voicesynthetizer.speechit("Modo Planificador")
        self.scheduler = Scheduler(misfire_grace_time=900, coalesce=True, threadpool=ThreadPool(max_threads=1))
        self.schedule()
        self.scheduler.start()<commit_msg>Cancun: Missing "," in list<commit_after>#!/usr/bin/python

import argparse
import commands
import logging
import os
import random
import signal
import sys
import thread
import time

from apscheduler.scheduler import Scheduler
from apscheduler.threadpool import ThreadPool

from core.irlp import Irlp
from core.voicesynthetizer import VoiceSynthetizer

# Production

from modules.alive import Alive
from modules.aprstracker import AprsTracker
from modules.aprstt import Aprstt
from modules.clock import Clock
from modules.identification import Identification
from modules.selfie import Selfie
from modules.voicecommand import VoiceCommand
from modules.weather import Weather
from modules.wolframalpha import WolframAlpha

# Experimental

from modules.assistant import Assistant
from modules.messages import Messages
from modules.meteorology import Meteorology
from learning.morseteacher import MorseTeacher
from modules.news import News
from modules.seismology import Seismology
from modules.voicemail import VoiceMail
from modules.voiceexperimental import VoiceExperimental

class Cancun(object):

    def __init__(self, voicesynthetizer, irlp):

        self.irlp = irlp
        self.voicesynthetizer = voicesynthetizer
        self.pidfile = None
        self.scheduler_status = False
        self.pidfile = "/tmp/cancun.pid"

    def __del__(self):
        pass

    def modules_setup(self):

        # Production Modules
        self.alive = Alive()
        self.aprstracker = AprsTracker(self.voicesynthetizer)
        self.aprstt = Aprstt(self.voicesynthetizer)
        self.clock = Clock(self.voicesynthetizer)
        self.identification = Identification(self.voicesynthetizer)
        self.selfie = Selfie(self.voicesynthetizer)
        self.voicecommand = VoiceCommand(self.voicesynthetizer)
        self.weather = Weather(self.voicesynthetizer)
        self.wolframalpha = WolframAlpha(self.voicesynthetizer)

        # Experimental Modules
        self.assistant = Assistant(self.voicesynthetizer)
        self.messages = Messages(self.voicesynthetizer)
        self.meteorology = Meteorology(self.voicesynthetizer)
        self.morseteacher = MorseTeacher(self.voicesynthetizer)
        self.news = News(self.voicesynthetizer)
        self.seismology = Seismology(self.voicesynthetizer)
        self.voicemail = VoiceMail(self.voicesynthetizer)
        self.voiceexperimental = VoiceExperimental(self.voicesynthetizer)

    def dtmf_setup(self,dtmf):
        dtmf_codes = {
        'PS0': 'alive',
        'PS1': 'aprstracker',
        'PS2': 'news',
        'PS3': 'meteorology',
        'PS4': 'selfie',
        'PS5': 'voicecommand',
        'PS6': 'wolframalpha',
        'PS7': 'voiceexperimental'
        }
        return dtmf_codes.get(dtmf)

    def enabled(self):
        return os.path.isfile(self.pidfile)

    def enable(self):

        pid = str(os.getpid())
        file(self.pidfile, 'w').write(pid)

    def disable(self):

        if self.enabled():
            os.unlink(self.pidfile)
        if self.scheduler_status:
            self.scheduler.shutdown()

    def scheduler_mode(self):

        logging.info('Mode Scheduler')
        self.voicesynthetizer.speechit("Modo Planificador")
        self.scheduler = Scheduler(misfire_grace_time=900, coalesce=True, threadpool=ThreadPool(max_threads=1))
        self.schedule()
        self.scheduler.start()
{'fraction_non_alphanumeric': 0.08302501109960042, 'fraction_numerical': 0.0035518721326032263, 'mean_word_length': 3.340398201669878, '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': '1236058', 'n_tokens_mistral': 2155, 'n_tokens_neox': 2017, 'n_words': 432}