def _create_test_circuits(qubits: list[cirq.Qid], n_circuits: int) -> list[cirq.Circuit]:
    """Helper function to generate circuits for testing."""
    if len(qubits) < 2:
        raise ValueError(
            "Need at least two qubits to generate two-qubit circuits."
        )  # pragma: no cover
    two_qubit_gates = [cirq.ISWAP**0.5, cirq.CNOT**0.5]
    input_circuits = []
    qubit_pairs = list(itertools.combinations(qubits, 2))
    num_pairs = len(qubit_pairs)
    for i in range(n_circuits):
        gate = two_qubit_gates[i % len(two_qubit_gates)]
        q0, q1 = qubit_pairs[i % num_pairs]
        circuits = rqcg.generate_library_of_2q_circuits(
            n_library_circuits=5, two_qubit_gate=gate, q0=q0, q1=q1
        )
        for circuit in circuits:
            circuit.append(cirq.measure(*qubits, key="m"))
        input_circuits.extend(circuits)
    return input_circuits
Helper function to generate circuits for testing.
cirq-core/cirq/contrib/shuffle_circuits/shuffle_circuits_with_readout_benchmarking_test.py