code: def require_repo(directory=None):
      
      if directory and not os.path.isdir(directory):
          raise ValueError('Directory not found: ' + repr(directory))
      repo = repo_path(directory)
      if not os.path.isdir(repo):
          raise RepositoryNotFoundError(directory)
      return repo
docs: Checks for a presentation repository and raises an exception if not found.