@webapi_check_local_site
    @webapi_check_login_required
    @webapi_response_errors(DOES_NOT_EXIST, REPO_INFO_ERROR,
                            REPO_NOT_IMPLEMENTED)
    def get(self, request, *args, **kwargs):
        """Retrieves an array of the branches in a repository."""
        try:
            repository = resources.repository.get_object(request, *args,
                                                         **kwargs)
        except ObjectDoesNotExist:
            return DOES_NOT_EXIST

        try:
            branches = []
            for branch in repository.get_branches():
                branches.append({
                    'id': branch.id,
                    'name': branch.name,
                    'commit': branch.commit,
                    'default': branch.default,
                })

            return 200, {
                self.item_result_key: branches,
            }
        except SCMError as e:
            return REPO_INFO_ERROR.with_message(six.text_type(e))
        except __HOLE__:
            return REPO_NOT_IMPLEMENTED
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/webapi/resources/repository_branches.py/RepositoryBranchesResource.get