import itertools


def _subfield_conflicts(conflicts, response_name, ast1, ast2):
    """Given a series of Conflicts which occurred between two sub-fields, generate a single Conflict."""
    if conflicts:
        return (
            (response_name, [conflict[0] for conflict in conflicts]),
            tuple(itertools.chain([ast1], *[conflict[1] for conflict in conflicts])),
            tuple(itertools.chain([ast2], *[conflict[2] for conflict in conflicts]))
        )