def all_roots(self):
    """Return all known source roots.

    Returns a generator over (source root, list of langs) pairs.

    Note: Requires a directory walk to match actual directories against patterns.
    However we don't descend into source roots, once found, so this should be fast in practice.
    Note: Does not follow symlinks.
    """
    buildroot = get_buildroot()
    # Note: If we support other SCMs in the future, add their metadata dirs here if relevant.
    ignore = {'.git'}.union({os.path.relpath(self._options[k], buildroot) for k in
                            ['pants_workdir', 'pants_supportdir', 'pants_distdir']})

    for dirpath, dirnames, _ in os.walk(buildroot, topdown=True):
      relpath = os.path.relpath(dirpath, buildroot)
      if relpath in ignore:
        del dirnames[:]  # Don't descend into ignored dirs.
      else:
        match = self._trie.find(relpath)
        if match:
          yield match  # Found a source root.
          del dirnames[:]  # Don't continue to walk into it.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/source/source_root.py/SourceRoots.all_roots/original