'A sequence of constraints that matches certain phrases in a sentence.
The given list of Constraint objects can contain nested lists (groups).'

def __init__(self, sequence=[], *args, **kwargs):

    def _ungroup(sequence, groups=None):
        for v in sequence:
            if isinstance(v, (list, tuple)):
                if (groups is not None):
                    groups.append(list(_ungroup(v, groups=None)))
                for v in _ungroup(v, groups):
                    (yield v)
            else:
                (yield v)
    self.groups = []
    self.sequence = list(_ungroup(sequence, groups=self.groups))
    i = 0
    for constraint in self.sequence:
        constraint.index = i
        i += 1
    self.strict = kwargs.get('strict', ((STRICT in args) and (not (GREEDY in args))))
    self.greedy = kwargs.get('greedy', (lambda chunk, constraint: True))
