@classmethod
    def check_repository(cls, path, username=None, password=None,
                         local_site_name=None):
        """
        Performs checks on a repository to test its validity.

        This should check if a repository exists and can be connected to.
        This will also check if the repository requires an HTTPS certificate.

        The result is returned as an exception. The exception may contain
        extra information, such as a human-readable description of the problem.
        If the repository is valid and can be connected to, no exception
        will be thrown.
        """
        super(BZRTool, cls).check_repository(path, username, password,
                                             local_site_name)

        if local_site_name and sshutils.is_ssh_uri(path):
            path += '?rb-local-site-name=%s' % local_site_name

        try:
            tree, branch, repository, relpath = \
                bzrdir.BzrDir.open_containing_tree_branch_or_repository(
                    path.encode('ascii'))
        except __HOLE__:
            raise RepositoryNotFoundError()
        except NotBranchError:
            raise RepositoryNotFoundError()
        except Exception as e:
            raise SCMError(e)
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/scmtools/bzr.py/BZRTool.check_repository