def is_di_repeat(kmer):
    """
    Return true if kmer represents a di-nucleotide repeat (e.g. ATATAT).
    """
    if not len(set(kmer)) == 2:
        return False
    return bool(len(set(kmer[::2])) == 1 and len(set(kmer[1::2])) == 1)
