def leave_module(self, node):
    for all_groups in self._bad_names.values():
        if (len(all_groups) < 2):
            continue
        groups = collections.defaultdict(list)
        min_warnings = sys.maxsize
        for group in all_groups.values():
            groups[len(group)].append(group)
            min_warnings = min(len(group), min_warnings)
        if (len(groups[min_warnings]) > 1):
            by_line = sorted(groups[min_warnings], key=(lambda group: min((warning[0].lineno for warning in group))))
            warnings = itertools.chain(*by_line[1:])
        else:
            warnings = groups[min_warnings][0]
        for args in warnings:
            self._raise_name_warning(*args)
def leave_module(self, node):
    for all_groups in self._bad_names.values():
        if (len(all_groups) < 2):
            continue
        groups = collections.defaultdict(list)
        min_warnings = sys.maxsize
        for group in all_groups.values():
            groups[len(group)].append(group)
            min_warnings = min(len(group), min_warnings)
        if (len(groups[min_warnings]) > 1):
            by_line = sorted(groups[min_warnings], key=(lambda group: min((warning[0].lineno for warning in group))))
            warnings = itertools.chain(*by_line[1:])
        else:
            warnings = groups[min_warnings][0]
        for args in warnings:
            self._raise_name_warning(*args)