def _do_walk(self, scm_relpath, topdown):
    if self._reader.isdir(scm_relpath):
      filenames = []
      dirnames = []

      for filename in self._reader.listdir(scm_relpath):
        path = os.path.join(scm_relpath, filename)
        if self._reader.isdir(path):
          dirnames.append(filename)
        else:
          filenames.append(filename)

      if topdown:
        yield (scm_relpath, dirnames, filenames)

      for dirname in dirnames:
        dirpath = os.path.join(scm_relpath, dirname)
        for item in self._do_walk(dirpath, topdown=topdown):
          yield item

      if not topdown:
        yield (scm_relpath, dirnames, filenames)
Create Type Block
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/base/scm_project_tree.py/ScmProjectTree._do_walk--crossover with--dataset/ETHPy150Open Yipit/pyeqs/tests/unit/test_type.py/test_add_type