def _match(seq1, seq2, mismatches):
    """
    Test if sequence seq1 and seq2 are sufficiently similar.

    Parameters
    ----------
    seq1 : str
        First sequence.
    seq2 : str
        Second sequence.
    mismatches : int
        Number of allowed mismatches between given sequences.

    Returns
    -------
    bool
        Do sequence `seq1` and `seq2` have less or equal than ``mismatches``

    """
    seq1, seq2 = seq1.upper(), seq2.upper()
    matches = sum([(nuc1 == 'N' or nuc2 == 'N' or nuc1 == nuc2) for nuc1, nuc2 in zip(seq1, seq2)])
    return max(len(seq1), len(seq2)) - matches <= mismatches