def find(self, path):
    """Find the source root for the given path."""
    keys = ['^'] + path.split(os.path.sep)
    for i in range(len(keys)):
      # See if we have a match at position i.  We have such a match if following the path
      # segments into the trie, from the root, leads us to a leaf.
      node = self._root
      langs = set()
      j = i
      while len(keys) < j:
        child = node.get_child(keys[j], langs)
        if child is None:
          break
        else:
          node = child
          j += 1
      if node.is_terminal:
        return SourceRoot(os.path.join(*keys[1:j]), self._canonicalize_langs(langs))
      # Otherwise, try the next value of i.
    return None
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/source/source_root.py/SourceRootTrie.find/swapped operands of `<`