def _expand_sequence(self, seq: list[GridQubit]) -> list[GridQubit]:
        """Tries to expand given sequence with more qubits.

        Args:
            seq: Linear sequence of qubits.

        Returns:
            New continuous linear sequence which contains all the qubits from
            seq and possibly new qubits inserted in between.
        """
        i = 1
        while i < len(seq):
            path = self._find_path_between(seq[i - 1], seq[i], set(seq))
            if path:
                seq = seq[:i] + path + seq[i:]
            else:
                i += 1
        return seq
Tries to expand given sequence with more qubits.

        Args:
            seq: Linear sequence of qubits.

        Returns:
            New continuous linear sequence which contains all the qubits from
            seq and possibly new qubits inserted in between.
        
cirq-google/cirq_google/line/placement/greedy.py