def _disjoint_nc2_combinations(
    qubit_pairs: Sequence[QidIntPair],
) -> list[tuple[QidIntPair, QidIntPair]]:
    """Gets disjoint pair combinations of qubits pairs.

    For example:

        >>> q = [*range(5)]
        >>> disjoint_swaps = cirq.transformers.routing.route_circuit_cqc._disjoint_nc2_combinations(
        ...     [(q[0], q[1]), (q[2], q[3]), (q[1], q[4])]
        ... )
        >>> disjoint_swaps == [((q[0], q[1]), (q[2], q[3])), ((q[2], q[3]), (q[1], q[4]))]
        True

    Args:
        qubit_pairs: list of qubit pairs to be combined.

    Returns:
        All 2-combinations between qubit pairs that are disjoint.
    """
    return [
        pair for pair in itertools.combinations(qubit_pairs, 2) if set(pair[0]).isdisjoint(pair[1])
    ]
Gets disjoint pair combinations of qubits pairs.

    For example:

        >>> q = [*range(5)]
        >>> disjoint_swaps = cirq.transformers.routing.route_circuit_cqc._disjoint_nc2_combinations(
        ...     [(q[0], q[1]), (q[2], q[3]), (q[1], q[4])]
        ... )
        >>> disjoint_swaps == [((q[0], q[1]), (q[2], q[3])), ((q[2], q[3]), (q[1], q[4]))]
        True

    Args:
        qubit_pairs: list of qubit pairs to be combined.

    Returns:
        All 2-combinations between qubit pairs that are disjoint.
    
cirq-core/cirq/transformers/routing/route_circuit_cqc.py