def remove_duplicates(errors):
    """ Filter duplicates from given error's list. """
    passed = defaultdict(list)
    for error in errors:
        key = error.linter, error.number
        if key in DUPLICATES:
            if key in passed[error.lnum]:
                continue
            passed[error.lnum] = DUPLICATES[key]
        yield error
def remove_duplicates ( errors ) : passed = defaultdict ( list ) for error in errors : key = error . linter , error . number if key in DUPLICATES : if key in passed [ error . lnum ] : continue passed [ error . lnum ] = DUPLICATES [ key ] yield error
Filter duplicates from given error's list.