def _choose_next_qubit(self, qubit: GridQubit, used: set[GridQubit]) -> GridQubit | None:
        """Selects next qubit on the linear sequence.

        Args:
            qubit: Last qubit which is already present on the linear sequence
                   of qubits.
            used: Set of forbidden qubits which can not be used.

        Returns:
            Next qubit to be appended to the linear sequence, chosen according
            to the greedy heuristic method. The returned qubit will be the one
            passed to the next invocation of this method. Returns None if no
            more qubits are available and search should stop.
        """
Selects next qubit on the linear sequence.

        Args:
            qubit: Last qubit which is already present on the linear sequence
                   of qubits.
            used: Set of forbidden qubits which can not be used.

        Returns:
            Next qubit to be appended to the linear sequence, chosen according
            to the greedy heuristic method. The returned qubit will be the one
            passed to the next invocation of this method. Returns None if no
            more qubits are available and search should stop.
        
cirq-google/cirq_google/line/placement/greedy.py