def METHOD_NAME(repos):
    repos_data = []
    for repo in repos.all():
        repo_git_url = repo.repo_html_url()
        repo_url = reverse('ci:view_repo', args=[repo.pk,])
        repo_desc = format_html('<span><a href="{}"><i class="{}"></i></a></span>', repo_git_url, repo.server().icon_class())
        repo_desc += format_html(' <span class="repo_name"><a href="{}">{}</a></span>', repo_url, repo.name)
        branches = []
        if hasattr(repo, "active_branches"):
            for branch in repo.active_branches:
                b_desc = '<a href="%s">%s</a>' % (reverse('ci:view_branch', args=[branch.pk,]), branch.name)
                branches.append({"id": branch.pk, "status": branch.status_slug(), "description": b_desc})
        badges = []
        if hasattr(repo, "active_badges"):
            for badge in repo.active_badges:
                b_desc = '<a href="%s">%s</a>' % (badge.url, badge.name)
                badges.append({"id": badge.pk, "status": models.JobStatus.to_slug(badge.status), "description": b_desc})
        prs = []
        for pr in repo.open_prs:
            url = reverse('ci:view_pr', args=[pr.pk])
            pr_desc = format_html('<span><a href="{}"><i class="{}"></i></a></span>',
                    pr.url,
                    pr.repository.server().icon_class())
            pr_desc += format_html(' <span class="boxed_job_status_{}" id="pr_status_{}"><a href="{}">#{}</a></span>',
                    pr.status_slug(),
                    pr.pk,
                    url,
                    pr.number)
            pr_desc += ' <span> %s by %s </span>' % (escape(pr.title), pr.username)
            prs.append({'id': pr.pk,
                'description': pr_desc,
                'number': pr.number,
                })
        if prs or branches or repo.active:
            repos_data.append({'id': repo.pk,
                'branches': branches,
                'badges': badges,
                'description': repo_desc,
                'prs': prs })
    return repos_data