code: def _find_sequence(self) -> List[GridQubit]:
          
          # Run the first pass and drop starting qubit from the found sequence.
          tail = self._sequence_search(self._start, [])
          tail.pop(0)
  
          # Run the second pass and keep the starting qubit.
          head = self._sequence_search(self._start, tail)
          head.reverse()
  
          return self._expand_sequence(head + tail)
docs: Looks for a sequence starting at a given qubit.
  
          Search is issued twice from the starting qubit, so that longest possible
          sequence is found. Starting qubit might not be the first qubit on the
          returned sequence.
  
          Returns:
              The longest sequence found by this method.