<commit_before>from .domain import Domain


class Zip(Domain):

    def __init__(self, domains, name=None):
        super(Zip, self).__init__(name)
        domains = tuple(domains)
        self._set_flags_from_domains(domains)
        self.domains = domains

    def _compute_size(self):
        return min([d.size for d in self.domains])

    def create_cn_iter(self):
        return self.create_iter()

    def create_iter(self, step=0):
        if not self.domains:
            return

        if step >= self.size:
            return

        iters = tuple(map(lambda d: d.create_iter(step), self.domains))

        while True:
            values = tuple(map(lambda i: i.next(), iters))
            yield values

    def generate_one(self):
        return tuple(map(lambda d: d.generate_one(), self.domains))
<commit_msg>ENH: disable strict domains and steps in Zip<commit_after>from .domain import Domain


class Zip(Domain):

    def __init__(self, domains, name=None):
        super(Zip, self).__init__(name)
        domains = tuple(domains)
        self._set_flags_from_domains(domains)
        self.domains = domains
        self.strict = False

    def _compute_size(self):
        return min(d.size for d in self.domains)

    def create_cn_iter(self):
        raise NotImplementedError()

    def create_iter(self, step=0):
        assert step == 0

        if not self.domains:
            return

        iters = tuple(map(lambda d: d.create_iter(step), self.domains))

        while True:
            values = tuple(map(lambda i: i.next(), iters))
            yield values

    def generate_one(self):
        return tuple(map(lambda d: d.generate_one(), self.domains))

{'fraction_non_alphanumeric': 0.10326409495548962, 'fraction_numerical': 0.0017804154302670622, 'mean_word_length': 2.3923541247484907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1838364', 'n_tokens_mistral': 528, 'n_tokens_neox': 485, 'n_words': 130}