<commit_before>import itertools

from .base import PactBase


class PactGroup(PactBase):

    def __init__(self, pacts=None, lazy=True):
        if pacts is None:
            pacts = []
        self._pacts = pacts[:]
        self._finished_pacts = []
        self._is_lazy = lazy
        super(PactGroup, self).__init__()

    def __iadd__(self, other):
        self.add(other)
        return self

    def __iter__(self):
        return itertools.chain(self._pacts, self._finished_pacts)<commit_msg>Use list instead of [:] to allow the pact argument to be an iterator<commit_after>import itertools

from .base import PactBase


class PactGroup(PactBase):

    def __init__(self, pacts=None, lazy=True):
        if pacts is None:
            pacts = []
        self._pacts = list(pacts)
        self._finished_pacts = []
        self._is_lazy = lazy
        super(PactGroup, self).__init__()

    def __iadd__(self, other):
        self.add(other)
        return self

    def __iter__(self):
        return itertools.chain(self._pacts, self._finished_pacts)
{'fraction_non_alphanumeric': 0.09829867674858223, 'fraction_numerical': 0.0, 'mean_word_length': 2.53, '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': '3894587', 'n_tokens_mistral': 342, 'n_tokens_neox': 334, 'n_words': 81}