def METHOD_NAME(slack_length, gates):
    sequence = repeated_rule(
        slack_length=slack_length,
        gates=gates,
    )
    num_reps = slack_length // len(gates)
    gate_set = {X, Y, Z}
    seq_gates = [op.gate for op in sequence.all_operations()]
    assert len(sequence) == slack_length
    assert gates * num_reps == [gate for gate in seq_gates if gate in gate_set]