from typing import List


def check_absence_of_stalled_pitches(
        movement: int,
        past_movements: List[int],
        max_n_repetitions: int = 2,
        **kwargs
) -> bool:
    """
    Check that a pitch is not excessively repeated.

    :param movement:
        melodic interval (in scale degrees) for line continuation
    :param past_movements:
        list of past movements
    :param max_n_repetitions:
        maximum allowed number of repetitions in a row
    :return:
        indicator whether a continuation is in accordance with the rule
    """
    if movement != 0:
        return True
    if len(past_movements) < max_n_repetitions - 1:
        return True
    changes = [x for x in past_movements[-max_n_repetitions+1:] if x != 0]
    return len(changes) > 0