<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(self, coll, constraint_spec, subject='collection'):
 """Validation of a collection. This is a generator that yields ConstraintViolationGroups. :param coll: Mongo collection :type coll: pymongo.Collection :param constraint_spec: Constraint specification :type constraint_spec: ConstraintSpec :param subject: Name of the thing being validated :type subject: str :return: Sets of constraint violation, one for each constraint_section :rtype: ConstraintViolationGroup :raises: ValidatorSyntaxError """

        self._spec = constraint_spec
        self._progress.set_subject(subject)
        self._build(constraint_spec)
        for sect_parts in self._sections:
            cvg = self._validate_section(subject, coll, sect_parts)
            if cvg is not None:
                yield cvg