<commit_before>from subprocess import call


class NanoTts(object):
    VOICES = [ "en-GB", "en-US", "de-DE", "es-ES", "fr-FR", "it-IT" ]

    def __init__(self):
        self.voice = "en-GB"
        self.noplay = False
        self.output = None

    @staticmethod
    def get_voices():
        """
        Returns available voices.
        """
        return NanoTts.VOICES

    def run(self, words):
        command_list = ["nanotts", ]
        if self.voice:
            command_list.extend(["-v", self.voice])
        if self.noplay:
            command_list.append("--no-play")
        if self.output:
            command_list.extend(["-o", self.output])
        command_list.extend(["-w", words])
        call(command_list)<commit_msg>Update libnanotts.py<commit_after>from subprocess import call


class NanoTts(object):
    VOICES = [ "en-GB", "en-US", "de-DE", "es-ES", "fr-FR", "it-IT" ]

    def __init__(self):
        self.voice = "en-GB"
        self.noplay = False
        self.output = None
        self.speed = None

    @staticmethod
    def get_voices():
        """
        Returns available voices.
        """
        return NanoTts.VOICES

    def run(self, words):
        command_list = ["nanotts", ]
        if self.voice:
            command_list.extend(["-v", self.voice])
        if self.noplay:
            command_list.append("--no-play")
        if self.output:
            command_list.extend(["-o", self.output])
        if self.speed:
            command_list.extend(["--speed", str(self.speed)])
        command_list.extend(["-w", words])
        call(command_list)
{'fraction_non_alphanumeric': 0.149812734082397, 'fraction_numerical': 0.0, 'mean_word_length': 1.9575645756457565, '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': '4767126', 'n_tokens_mistral': 532, 'n_tokens_neox': 506, 'n_words': 102}