def _verify_and_get_two_qubits_from_circuits(circuits: Sequence[cirq.Circuit]):
    """Make sure each of the provided circuits uses the same two qubits and return them."""
    all_qubits_set: set[cirq.Qid] = set()
    all_qubits_set = all_qubits_set.union(*(circuit.all_qubits() for circuit in circuits))
    all_qubits_list = sorted(all_qubits_set)
    if len(all_qubits_list) != 2:
        raise ValueError(
            "`circuits` should be a sequence of circuits each operating on the same two qubits."
        )
    return all_qubits_list
Make sure each of the provided circuits uses the same two qubits and return them.
cirq-core/cirq/experiments/xeb_sampling.py