(
    policy_breaks: List[PolicyBreak],
)
return flat_match_dict
flatten_policy_breaks_by_line flatens a list of occurrences with the
    same ignore SHA into a dict of incidents.
flatten_policy_breaks_by_line flatens a list of occurrences with the
    same ignore SHA into a dict of incidents.
flatten_policy_breaks_by_line flatens a list of occurrences with the same ignore SHA into a dict of incidents .
def flatten_policy_breaks_by_line(
    policy_breaks: List[PolicyBreak],
) -> Dict[int, List[Match]]:
    """
    flatten_policy_breaks_by_line flatens a list of occurrences with the
    same ignore SHA into a dict of incidents.
    """
    flat_match_dict: Dict[int, List[Match]] = dict()
    for policy_break in policy_breaks:
        for match in policy_break.matches:
            flat_match_list = flat_match_dict.get(match.line_start)
            if flat_match_list and not any(
                match.index_start == flat_match.index_start
                for flat_match in flat_match_list
            ):
                flat_match_list.append(match)
            else:
                flat_match_dict[match.line_start] = [match]

    return flat_match_dict
def flatten_policy_breaks_by_line ( policy_breaks : List [ PolicyBreak ] , ) -> Dict [ int , List [ Match ] ] : flat_match_dict : Dict [ int , List [ Match ] ] = dict ( ) for policy_break in policy_breaks : for match in policy_break . matches : flat_match_list = flat_match_dict . get ( match . line_start ) if flat_match_list and not any ( match . index_start == flat_match . index_start for flat_match in flat_match_list ) : flat_match_list . append ( match ) else : flat_match_dict [ match . line_start ] = [ match ] return flat_match_dict