def open_repo_closing(path_or_repo):
 if isinstance(path_or_repo, BaseRepo):
  return _noop_context_manager(path_or_repo)
 return closing(Repo(path_or_repo))

def open_repo_closing ( path_or_repo ) : if isinstance ( path_or_repo , BaseRepo ) : return _noop_context_manager ( path_or_repo ) return closing ( Repo ( path_or_repo ) )
open an argument that can be a repository or a path for a repository .