@log_calls
  def enclosing_scope(self, path):
    # XXX A bit slow.
    scopes = set([c.scope for c in self.checkouts()])
    # Walk upward, so we pick the smallest enclosing scope.
    for (parent_path, _rel_path) in parent_dirs(path):
      if parent_path in scopes:
        return parent_path
    return None
dataset/ETHPy150Open bloomreach/zinc/zinc.py/WorkingDir.enclosing_scope/original