def __find_number_of_repeats(seq_before, seq, seq_after):
    """

    Finds the number of repeats before or after a mutation.

    :param seq_before: the genomic sequence before the mutation (str)
    :param seq: the genomic sequence of the mutation (str)
    :param seq_after: the sequence after the mutation (str)

    :returns: number of repeats (int)

    """
    tmp_seq = seq_after
    k = 0
    while tmp_seq[:len(seq)] == seq:
        k += 1
        tmp_seq = tmp_seq[len(seq):]
    tmp_seq = seq_before[::-1]
    seq = seq[::-1]
    while tmp_seq[:len(seq)] == seq:
        k += 1
        tmp_seq = tmp_seq[len(seq):]
    return k + 1