<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_violations(self, violations, record=None):
 """Add constraint violations and associated record. :param violations: List of violations :type violations: list(ConstraintViolation) :param record: Associated record :type record: dict :rtype: None """

        rec = {} if record is None else record
        for v in violations:
            self._viol.append((v, rec))