<commit_before>"""Specialization of Service to have many services"""

from .service import Service


class MetaService(Service):
    """Keep a list of all the services that are included in this metaservice"""
    def __init__(self, service):
        Service.__init__(self, service)
        self.services = []
        self.append = self.services.append

    def __len__(self):
        return len(self.services)

    def __getitem__(self, key):
        return self.services[key]

    def __setitem__(self, key, value):
        self.services[key] = value

    def __delitem__(self, key):
        del self.services[key]

    def __add__(self, other):
        return self.services + other<commit_msg>Uniservices are required by default, metaservices are optional by default<commit_after>"""Specialization of Service to have many services"""

from .service import Service


class MetaService(Service):
    """Keep a list of all the services that are included in this metaservice"""
    def __init__(self, service):
        if len(set(service.keys()) & {'required', 'optional'}) == 0:
            service['required'] = False
        Service.__init__(self, service)
        self.services = []
        self.append = self.services.append

    def __len__(self):
        return len(self.services)

    def __getitem__(self, key):
        return self.services[key]

    def __setitem__(self, key, value):
        self.services[key] = value

    def __delitem__(self, key):
        del self.services[key]

    def __str__(self):
        return "".join(["{'", self.service, "': ", str(self.services), "}"])
{'fraction_non_alphanumeric': 0.11746231155778894, 'fraction_numerical': 0.000628140703517588, 'mean_word_length': 3.0329113924050635, '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': '6249775', 'n_tokens_mistral': 449, 'n_tokens_neox': 438, 'n_words': 135}