#!/usr/bin/env python
# coding: utf-8

import os

# Results parsed from this unwieldy curl invocation:
#
#   curl -i -G https://api.github.com/search/repositories"?page={1,2,3,4,5}" \
#       -d "q=language:python"
#       -d "sort=stars"
#       -d "per_page=2"
#       --header "Accept: application/vnd.github.v3+json" > sample/requests.http
#

search_bodies = [
    r"""{
  "total_count": 497395,
  "incomplete_results": false,
  "items": [
    {
      "id": 3544424,
      "name": "httpie",
      "full_name": "jakubroztocil/httpie",
      "owner": {
        "login": "jakubroztocil",
        "id": 326885,
        "avatar_url": "https://avatars.githubusercontent.com/u/326885?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/jakubroztocil",
        "html_url": "https://github.com/jakubroztocil",
        "followers_url": "https://api.github.com/users/jakubroztocil/followers",
        "following_url": "https://api.github.com/users/jakubroztocil/following{/other_user}",
        "gists_url": "https://api.github.com/users/jakubroztocil/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/jakubroztocil/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/jakubroztocil/subscriptions",
        "organizations_url": "https://api.github.com/users/jakubroztocil/orgs",
        "repos_url": "https://api.github.com/users/jakubroztocil/repos",
        "events_url": "https://api.github.com/users/jakubroztocil/events{/privacy}",
        "received_events_url": "https://api.github.com/users/jakubroztocil/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/jakubroztocil/httpie",
      "description": "HTTPie is a command line HTTP client, a user-friendly cURL replacement.",
      "fork": false,
      "url": "https://api.github.com/repos/jakubroztocil/httpie",
      "forks_url": "https://api.github.com/repos/jakubroztocil/httpie/forks",
      "keys_url": "https://api.github.com/repos/jakubroztocil/httpie/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/jakubroztocil/httpie/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/jakubroztocil/httpie/teams",
      "hooks_url": "https://api.github.com/repos/jakubroztocil/httpie/hooks",
      "issue_events_url": "https://api.github.com/repos/jakubroztocil/httpie/issues/events{/number}",
      "events_url": "https://api.github.com/repos/jakubroztocil/httpie/events",
      "assignees_url": "https://api.github.com/repos/jakubroztocil/httpie/assignees{/user}",
      "branches_url": "https://api.github.com/repos/jakubroztocil/httpie/branches{/branch}",
      "tags_url": "https://api.github.com/repos/jakubroztocil/httpie/tags",
      "blobs_url": "https://api.github.com/repos/jakubroztocil/httpie/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/jakubroztocil/httpie/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/jakubroztocil/httpie/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/jakubroztocil/httpie/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/jakubroztocil/httpie/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/jakubroztocil/httpie/languages",
      "stargazers_url": "https://api.github.com/repos/jakubroztocil/httpie/stargazers",
      "contributors_url": "https://api.github.com/repos/jakubroztocil/httpie/contributors",
      "subscribers_url": "https://api.github.com/repos/jakubroztocil/httpie/subscribers",
      "subscription_url": "https://api.github.com/repos/jakubroztocil/httpie/subscription",
      "commits_url": "https://api.github.com/repos/jakubroztocil/httpie/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/jakubroztocil/httpie/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/jakubroztocil/httpie/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/jakubroztocil/httpie/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/jakubroztocil/httpie/contents/{+path}",
      "compare_url": "https://api.github.com/repos/jakubroztocil/httpie/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/jakubroztocil/httpie/merges",
      "archive_url": "https://api.github.com/repos/jakubroztocil/httpie/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/jakubroztocil/httpie/downloads",
      "issues_url": "https://api.github.com/repos/jakubroztocil/httpie/issues{/number}",
      "pulls_url": "https://api.github.com/repos/jakubroztocil/httpie/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/jakubroztocil/httpie/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/jakubroztocil/httpie/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/jakubroztocil/httpie/labels{/name}",
      "releases_url": "https://api.github.com/repos/jakubroztocil/httpie/releases{/id}",
      "created_at": "2012-02-25T12:39:13Z",
      "updated_at": "2014-11-13T16:38:22Z",
      "pushed_at": "2014-10-20T12:41:52Z",
      "git_url": "git://github.com/jakubroztocil/httpie.git",
      "ssh_url": "git@github.com:jakubroztocil/httpie.git",
      "clone_url": "https://github.com/jakubroztocil/httpie.git",
      "svn_url": "https://github.com/jakubroztocil/httpie",
      "homepage": "httpie.org",
      "size": 5367,
      "stargazers_count": 12275,
      "watchers_count": 12275,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": false,
      "has_pages": false,
      "forks_count": 698,
      "mirror_url": null,
      "open_issues_count": 59,
      "forks": 698,
      "open_issues": 59,
      "watchers": 12275,
      "default_branch": "master",
      "score": 1.0
    },
    {
      "id": 4164482,
      "name": "django",
      "full_name": "django/django",
      "owner": {
        "login": "django",
        "id": 27804,
        "avatar_url": "https://avatars.githubusercontent.com/u/27804?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/django",
        "html_url": "https://github.com/django",
        "followers_url": "https://api.github.com/users/django/followers",
        "following_url": "https://api.github.com/users/django/following{/other_user}",
        "gists_url": "https://api.github.com/users/django/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/django/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/django/subscriptions",
        "organizations_url": "https://api.github.com/users/django/orgs",
        "repos_url": "https://api.github.com/users/django/repos",
        "events_url": "https://api.github.com/users/django/events{/privacy}",
        "received_events_url": "https://api.github.com/users/django/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/django/django",
      "description": "The Web framework for perfectionists with deadlines.",
      "fork": false,
      "url": "https://api.github.com/repos/django/django",
      "forks_url": "https://api.github.com/repos/django/django/forks",
      "keys_url": "https://api.github.com/repos/django/django/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/django/django/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/django/django/teams",
      "hooks_url": "https://api.github.com/repos/django/django/hooks",
      "issue_events_url": "https://api.github.com/repos/django/django/issues/events{/number}",
      "events_url": "https://api.github.com/repos/django/django/events",
      "assignees_url": "https://api.github.com/repos/django/django/assignees{/user}",
      "branches_url": "https://api.github.com/repos/django/django/branches{/branch}",
      "tags_url": "https://api.github.com/repos/django/django/tags",
      "blobs_url": "https://api.github.com/repos/django/django/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/django/django/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/django/django/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/django/django/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/django/django/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/django/django/languages",
      "stargazers_url": "https://api.github.com/repos/django/django/stargazers",
      "contributors_url": "https://api.github.com/repos/django/django/contributors",
      "subscribers_url": "https://api.github.com/repos/django/django/subscribers",
      "subscription_url": "https://api.github.com/repos/django/django/subscription",
      "commits_url": "https://api.github.com/repos/django/django/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/django/django/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/django/django/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/django/django/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/django/django/contents/{+path}",
      "compare_url": "https://api.github.com/repos/django/django/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/django/django/merges",
      "archive_url": "https://api.github.com/repos/django/django/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/django/django/downloads",
      "issues_url": "https://api.github.com/repos/django/django/issues{/number}",
      "pulls_url": "https://api.github.com/repos/django/django/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/django/django/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/django/django/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/django/django/labels{/name}",
      "releases_url": "https://api.github.com/repos/django/django/releases{/id}",
      "created_at": "2012-04-28T02:47:18Z",
      "updated_at": "2014-11-13T17:45:40Z",
      "pushed_at": "2014-11-13T19:16:45Z",
      "git_url": "git://github.com/django/django.git",
      "ssh_url": "git@github.com:django/django.git",
      "clone_url": "https://github.com/django/django.git",
      "svn_url": "https://github.com/django/django",
      "homepage": "https://www.djangoproject.com/",
      "size": 259306,
      "stargazers_count": 11865,
      "watchers_count": 11865,
      "language": "Python",
      "has_issues": false,
      "has_downloads": true,
      "has_wiki": false,
      "has_pages": false,
      "forks_count": 4650,
      "mirror_url": null,
      "open_issues_count": 82,
      "forks": 4650,
      "open_issues": 82,
      "watchers": 11865,
      "default_branch": "master",
      "score": 1.0
    }
  ]
}""",
    r"""{
  "total_count": 497395,
  "incomplete_results": false,
  "items": [
    {
      "id": 1362490,
      "name": "requests",
      "full_name": "kennethreitz/requests",
      "owner": {
        "login": "kennethreitz",
        "id": 119893,
        "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/kennethreitz",
        "html_url": "https://github.com/kennethreitz",
        "followers_url": "https://api.github.com/users/kennethreitz/followers",
        "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
        "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
        "organizations_url": "https://api.github.com/users/kennethreitz/orgs",
        "repos_url": "https://api.github.com/users/kennethreitz/repos",
        "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
        "received_events_url": "https://api.github.com/users/kennethreitz/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/kennethreitz/requests",
      "description": "Python HTTP Requests for Humans™.",
      "fork": false,
      "url": "https://api.github.com/repos/kennethreitz/requests",
      "forks_url": "https://api.github.com/repos/kennethreitz/requests/forks",
      "keys_url": "https://api.github.com/repos/kennethreitz/requests/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/kennethreitz/requests/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/kennethreitz/requests/teams",
      "hooks_url": "https://api.github.com/repos/kennethreitz/requests/hooks",
      "issue_events_url": "https://api.github.com/repos/kennethreitz/requests/issues/events{/number}",
      "events_url": "https://api.github.com/repos/kennethreitz/requests/events",
      "assignees_url": "https://api.github.com/repos/kennethreitz/requests/assignees{/user}",
      "branches_url": "https://api.github.com/repos/kennethreitz/requests/branches{/branch}",
      "tags_url": "https://api.github.com/repos/kennethreitz/requests/tags",
      "blobs_url": "https://api.github.com/repos/kennethreitz/requests/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/kennethreitz/requests/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/kennethreitz/requests/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/kennethreitz/requests/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/kennethreitz/requests/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/kennethreitz/requests/languages",
      "stargazers_url": "https://api.github.com/repos/kennethreitz/requests/stargazers",
      "contributors_url": "https://api.github.com/repos/kennethreitz/requests/contributors",
      "subscribers_url": "https://api.github.com/repos/kennethreitz/requests/subscribers",
      "subscription_url": "https://api.github.com/repos/kennethreitz/requests/subscription",
      "commits_url": "https://api.github.com/repos/kennethreitz/requests/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/kennethreitz/requests/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/kennethreitz/requests/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/kennethreitz/requests/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/kennethreitz/requests/contents/{+path}",
      "compare_url": "https://api.github.com/repos/kennethreitz/requests/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/kennethreitz/requests/merges",
      "archive_url": "https://api.github.com/repos/kennethreitz/requests/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/kennethreitz/requests/downloads",
      "issues_url": "https://api.github.com/repos/kennethreitz/requests/issues{/number}",
      "pulls_url": "https://api.github.com/repos/kennethreitz/requests/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/kennethreitz/requests/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/kennethreitz/requests/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/kennethreitz/requests/labels{/name}",
      "releases_url": "https://api.github.com/repos/kennethreitz/requests/releases{/id}",
      "created_at": "2011-02-13T18:38:17Z",
      "updated_at": "2014-11-13T19:09:14Z",
      "pushed_at": "2014-11-12T17:36:03Z",
      "git_url": "git://github.com/kennethreitz/requests.git",
      "ssh_url": "git@github.com:kennethreitz/requests.git",
      "clone_url": "https://github.com/kennethreitz/requests.git",
      "svn_url": "https://github.com/kennethreitz/requests",
      "homepage": "python-requests.org",
      "size": 15836,
      "stargazers_count": 11622,
      "watchers_count": 11622,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": false,
      "forks_count": 1846,
      "mirror_url": null,
      "open_issues_count": 78,
      "forks": 1846,
      "open_issues": 78,
      "watchers": 11622,
      "default_branch": "master",
      "score": 1.0
    },
    {
      "id": 596892,
      "name": "flask",
      "full_name": "mitsuhiko/flask",
      "owner": {
        "login": "mitsuhiko",
        "id": 7396,
        "avatar_url": "https://avatars.githubusercontent.com/u/7396?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/mitsuhiko",
        "html_url": "https://github.com/mitsuhiko",
        "followers_url": "https://api.github.com/users/mitsuhiko/followers",
        "following_url": "https://api.github.com/users/mitsuhiko/following{/other_user}",
        "gists_url": "https://api.github.com/users/mitsuhiko/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/mitsuhiko/subscriptions",
        "organizations_url": "https://api.github.com/users/mitsuhiko/orgs",
        "repos_url": "https://api.github.com/users/mitsuhiko/repos",
        "events_url": "https://api.github.com/users/mitsuhiko/events{/privacy}",
        "received_events_url": "https://api.github.com/users/mitsuhiko/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/mitsuhiko/flask",
      "description": "A microframework based on Werkzeug, Jinja2 and good intentions",
      "fork": false,
      "url": "https://api.github.com/repos/mitsuhiko/flask",
      "forks_url": "https://api.github.com/repos/mitsuhiko/flask/forks",
      "keys_url": "https://api.github.com/repos/mitsuhiko/flask/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/mitsuhiko/flask/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/mitsuhiko/flask/teams",
      "hooks_url": "https://api.github.com/repos/mitsuhiko/flask/hooks",
      "issue_events_url": "https://api.github.com/repos/mitsuhiko/flask/issues/events{/number}",
      "events_url": "https://api.github.com/repos/mitsuhiko/flask/events",
      "assignees_url": "https://api.github.com/repos/mitsuhiko/flask/assignees{/user}",
      "branches_url": "https://api.github.com/repos/mitsuhiko/flask/branches{/branch}",
      "tags_url": "https://api.github.com/repos/mitsuhiko/flask/tags",
      "blobs_url": "https://api.github.com/repos/mitsuhiko/flask/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/mitsuhiko/flask/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/mitsuhiko/flask/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/mitsuhiko/flask/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/mitsuhiko/flask/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/mitsuhiko/flask/languages",
      "stargazers_url": "https://api.github.com/repos/mitsuhiko/flask/stargazers",
      "contributors_url": "https://api.github.com/repos/mitsuhiko/flask/contributors",
      "subscribers_url": "https://api.github.com/repos/mitsuhiko/flask/subscribers",
      "subscription_url": "https://api.github.com/repos/mitsuhiko/flask/subscription",
      "commits_url": "https://api.github.com/repos/mitsuhiko/flask/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/mitsuhiko/flask/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/mitsuhiko/flask/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/mitsuhiko/flask/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/mitsuhiko/flask/contents/{+path}",
      "compare_url": "https://api.github.com/repos/mitsuhiko/flask/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/mitsuhiko/flask/merges",
      "archive_url": "https://api.github.com/repos/mitsuhiko/flask/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/mitsuhiko/flask/downloads",
      "issues_url": "https://api.github.com/repos/mitsuhiko/flask/issues{/number}",
      "pulls_url": "https://api.github.com/repos/mitsuhiko/flask/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/mitsuhiko/flask/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/mitsuhiko/flask/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/mitsuhiko/flask/labels{/name}",
      "releases_url": "https://api.github.com/repos/mitsuhiko/flask/releases{/id}",
      "created_at": "2010-04-06T11:11:59Z",
      "updated_at": "2014-11-13T16:58:38Z",
      "pushed_at": "2014-11-12T13:17:31Z",
      "git_url": "git://github.com/mitsuhiko/flask.git",
      "ssh_url": "git@github.com:mitsuhiko/flask.git",
      "clone_url": "https://github.com/mitsuhiko/flask.git",
      "svn_url": "https://github.com/mitsuhiko/flask",
      "homepage": "http://flask.pocoo.org/",
      "size": 14806,
      "stargazers_count": 11535,
      "watchers_count": 11535,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": false,
      "forks_count": 3105,
      "mirror_url": null,
      "open_issues_count": 106,
      "forks": 3105,
      "open_issues": 106,
      "watchers": 11535,
      "default_branch": "master",
      "score": 1.0
    }
  ]
}""",
    """{
  "total_count": 497395,
  "incomplete_results": false,
  "items": [
    {
      "id": 3638964,
      "name": "ansible",
      "full_name": "ansible/ansible",
      "owner": {
        "login": "ansible",
        "id": 1507452,
        "avatar_url": "https://avatars.githubusercontent.com/u/1507452?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/ansible",
        "html_url": "https://github.com/ansible",
        "followers_url": "https://api.github.com/users/ansible/followers",
        "following_url": "https://api.github.com/users/ansible/following{/other_user}",
        "gists_url": "https://api.github.com/users/ansible/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/ansible/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/ansible/subscriptions",
        "organizations_url": "https://api.github.com/users/ansible/orgs",
        "repos_url": "https://api.github.com/users/ansible/repos",
        "events_url": "https://api.github.com/users/ansible/events{/privacy}",
        "received_events_url": "https://api.github.com/users/ansible/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/ansible/ansible",
      "description": "Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.",
      "fork": false,
      "url": "https://api.github.com/repos/ansible/ansible",
      "forks_url": "https://api.github.com/repos/ansible/ansible/forks",
      "keys_url": "https://api.github.com/repos/ansible/ansible/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/ansible/ansible/teams",
      "hooks_url": "https://api.github.com/repos/ansible/ansible/hooks",
      "issue_events_url": "https://api.github.com/repos/ansible/ansible/issues/events{/number}",
      "events_url": "https://api.github.com/repos/ansible/ansible/events",
      "assignees_url": "https://api.github.com/repos/ansible/ansible/assignees{/user}",
      "branches_url": "https://api.github.com/repos/ansible/ansible/branches{/branch}",
      "tags_url": "https://api.github.com/repos/ansible/ansible/tags",
      "blobs_url": "https://api.github.com/repos/ansible/ansible/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/ansible/ansible/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/ansible/ansible/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/ansible/ansible/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/ansible/ansible/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/ansible/ansible/languages",
      "stargazers_url": "https://api.github.com/repos/ansible/ansible/stargazers",
      "contributors_url": "https://api.github.com/repos/ansible/ansible/contributors",
      "subscribers_url": "https://api.github.com/repos/ansible/ansible/subscribers",
      "subscription_url": "https://api.github.com/repos/ansible/ansible/subscription",
      "commits_url": "https://api.github.com/repos/ansible/ansible/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/ansible/ansible/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/ansible/ansible/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/ansible/ansible/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/ansible/ansible/contents/{+path}",
      "compare_url": "https://api.github.com/repos/ansible/ansible/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/ansible/ansible/merges",
      "archive_url": "https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/ansible/ansible/downloads",
      "issues_url": "https://api.github.com/repos/ansible/ansible/issues{/number}",
      "pulls_url": "https://api.github.com/repos/ansible/ansible/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/ansible/ansible/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/ansible/ansible/labels{/name}",
      "releases_url": "https://api.github.com/repos/ansible/ansible/releases{/id}",
      "created_at": "2012-03-06T14:58:02Z",
      "updated_at": "2014-11-13T19:04:19Z",
      "pushed_at": "2014-11-13T17:55:14Z",
      "git_url": "git://github.com/ansible/ansible.git",
      "ssh_url": "git@github.com:ansible/ansible.git",
      "clone_url": "https://github.com/ansible/ansible.git",
      "svn_url": "https://github.com/ansible/ansible",
      "homepage": "http://ansible.com/",
      "size": 206318,
      "stargazers_count": 8327,
      "watchers_count": 8327,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": false,
      "has_pages": false,
      "forks_count": 2592,
      "mirror_url": null,
      "open_issues_count": 445,
      "forks": 2592,
      "open_issues": 445,
      "watchers": 8327,
      "default_branch": "devel",
      "score": 1.0
    },
    {
      "id": 301742,
      "name": "tornado",
      "full_name": "tornadoweb/tornado",
      "owner": {
        "login": "tornadoweb",
        "id": 7468980,
        "avatar_url": "https://avatars.githubusercontent.com/u/7468980?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/tornadoweb",
        "html_url": "https://github.com/tornadoweb",
        "followers_url": "https://api.github.com/users/tornadoweb/followers",
        "following_url": "https://api.github.com/users/tornadoweb/following{/other_user}",
        "gists_url": "https://api.github.com/users/tornadoweb/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/tornadoweb/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/tornadoweb/subscriptions",
        "organizations_url": "https://api.github.com/users/tornadoweb/orgs",
        "repos_url": "https://api.github.com/users/tornadoweb/repos",
        "events_url": "https://api.github.com/users/tornadoweb/events{/privacy}",
        "received_events_url": "https://api.github.com/users/tornadoweb/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/tornadoweb/tornado",
      "description": "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.",
      "fork": false,
      "url": "https://api.github.com/repos/tornadoweb/tornado",
      "forks_url": "https://api.github.com/repos/tornadoweb/tornado/forks",
      "keys_url": "https://api.github.com/repos/tornadoweb/tornado/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/tornadoweb/tornado/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/tornadoweb/tornado/teams",
      "hooks_url": "https://api.github.com/repos/tornadoweb/tornado/hooks",
      "issue_events_url": "https://api.github.com/repos/tornadoweb/tornado/issues/events{/number}",
      "events_url": "https://api.github.com/repos/tornadoweb/tornado/events",
      "assignees_url": "https://api.github.com/repos/tornadoweb/tornado/assignees{/user}",
      "branches_url": "https://api.github.com/repos/tornadoweb/tornado/branches{/branch}",
      "tags_url": "https://api.github.com/repos/tornadoweb/tornado/tags",
      "blobs_url": "https://api.github.com/repos/tornadoweb/tornado/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/tornadoweb/tornado/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/tornadoweb/tornado/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/tornadoweb/tornado/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/tornadoweb/tornado/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/tornadoweb/tornado/languages",
      "stargazers_url": "https://api.github.com/repos/tornadoweb/tornado/stargazers",
      "contributors_url": "https://api.github.com/repos/tornadoweb/tornado/contributors",
      "subscribers_url": "https://api.github.com/repos/tornadoweb/tornado/subscribers",
      "subscription_url": "https://api.github.com/repos/tornadoweb/tornado/subscription",
      "commits_url": "https://api.github.com/repos/tornadoweb/tornado/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/tornadoweb/tornado/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/tornadoweb/tornado/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/tornadoweb/tornado/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/tornadoweb/tornado/contents/{+path}",
      "compare_url": "https://api.github.com/repos/tornadoweb/tornado/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/tornadoweb/tornado/merges",
      "archive_url": "https://api.github.com/repos/tornadoweb/tornado/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/tornadoweb/tornado/downloads",
      "issues_url": "https://api.github.com/repos/tornadoweb/tornado/issues{/number}",
      "pulls_url": "https://api.github.com/repos/tornadoweb/tornado/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/tornadoweb/tornado/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/tornadoweb/tornado/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/tornadoweb/tornado/labels{/name}",
      "releases_url": "https://api.github.com/repos/tornadoweb/tornado/releases{/id}",
      "created_at": "2009-09-09T04:55:16Z",
      "updated_at": "2014-11-13T14:21:57Z",
      "pushed_at": "2014-11-11T04:13:53Z",
      "git_url": "git://github.com/tornadoweb/tornado.git",
      "ssh_url": "git@github.com:tornadoweb/tornado.git",
      "clone_url": "https://github.com/tornadoweb/tornado.git",
      "svn_url": "https://github.com/tornadoweb/tornado",
      "homepage": "http://www.tornadoweb.org/",
      "size": 20006,
      "stargazers_count": 8033,
      "watchers_count": 8033,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 2240,
      "mirror_url": null,
      "open_issues_count": 124,
      "forks": 2240,
      "open_issues": 124,
      "watchers": 8033,
      "default_branch": "master",
      "score": 1.0
    }
  ]
}""",
    r"""{
  "total_count": 497395,
  "incomplete_results": false,
  "items": [
    {
      "id": 20429943,
      "name": "the-swift-programming-language-in-chinese",
      "full_name": "numbbbbb/the-swift-programming-language-in-chinese",
      "owner": {
        "login": "numbbbbb",
        "id": 2572987,
        "avatar_url": "https://avatars.githubusercontent.com/u/2572987?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/numbbbbb",
        "html_url": "https://github.com/numbbbbb",
        "followers_url": "https://api.github.com/users/numbbbbb/followers",
        "following_url": "https://api.github.com/users/numbbbbb/following{/other_user}",
        "gists_url": "https://api.github.com/users/numbbbbb/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/numbbbbb/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/numbbbbb/subscriptions",
        "organizations_url": "https://api.github.com/users/numbbbbb/orgs",
        "repos_url": "https://api.github.com/users/numbbbbb/repos",
        "events_url": "https://api.github.com/users/numbbbbb/events{/privacy}",
        "received_events_url": "https://api.github.com/users/numbbbbb/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/numbbbbb/the-swift-programming-language-in-chinese",
      "description": "中文版 Apple 官方 Swift 教程《The Swift Programming Language》",
      "fork": false,
      "url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese",
      "forks_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/forks",
      "keys_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/teams",
      "hooks_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/hooks",
      "issue_events_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/issues/events{/number}",
      "events_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/events",
      "assignees_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/assignees{/user}",
      "branches_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/branches{/branch}",
      "tags_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/tags",
      "blobs_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/languages",
      "stargazers_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/stargazers",
      "contributors_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/contributors",
      "subscribers_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/subscribers",
      "subscription_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/subscription",
      "commits_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/contents/{+path}",
      "compare_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/merges",
      "archive_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/downloads",
      "issues_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/issues{/number}",
      "pulls_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/labels{/name}",
      "releases_url": "https://api.github.com/repos/numbbbbb/the-swift-programming-language-in-chinese/releases{/id}",
      "created_at": "2014-06-03T04:44:09Z",
      "updated_at": "2014-11-13T11:30:27Z",
      "pushed_at": "2014-11-03T08:40:09Z",
      "git_url": "git://github.com/numbbbbb/the-swift-programming-language-in-chinese.git",
      "ssh_url": "git@github.com:numbbbbb/the-swift-programming-language-in-chinese.git",
      "clone_url": "https://github.com/numbbbbb/the-swift-programming-language-in-chinese.git",
      "svn_url": "https://github.com/numbbbbb/the-swift-programming-language-in-chinese",
      "homepage": "http://numbbbbb.github.io/the-swift-programming-language-in-chinese/",
      "size": 29375,
      "stargazers_count": 7641,
      "watchers_count": 7641,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 2265,
      "mirror_url": null,
      "open_issues_count": 12,
      "forks": 2265,
      "open_issues": 12,
      "watchers": 7641,
      "default_branch": "gh-pages",
      "score": 1.0
    },
    {
      "id": 26554,
      "name": "reddit",
      "full_name": "reddit/reddit",
      "owner": {
        "login": "reddit",
        "id": 14248,
        "avatar_url": "https://avatars.githubusercontent.com/u/14248?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/reddit",
        "html_url": "https://github.com/reddit",
        "followers_url": "https://api.github.com/users/reddit/followers",
        "following_url": "https://api.github.com/users/reddit/following{/other_user}",
        "gists_url": "https://api.github.com/users/reddit/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/reddit/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/reddit/subscriptions",
        "organizations_url": "https://api.github.com/users/reddit/orgs",
        "repos_url": "https://api.github.com/users/reddit/repos",
        "events_url": "https://api.github.com/users/reddit/events{/privacy}",
        "received_events_url": "https://api.github.com/users/reddit/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/reddit/reddit",
      "description": "the code that powers reddit.com",
      "fork": false,
      "url": "https://api.github.com/repos/reddit/reddit",
      "forks_url": "https://api.github.com/repos/reddit/reddit/forks",
      "keys_url": "https://api.github.com/repos/reddit/reddit/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/reddit/reddit/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/reddit/reddit/teams",
      "hooks_url": "https://api.github.com/repos/reddit/reddit/hooks",
      "issue_events_url": "https://api.github.com/repos/reddit/reddit/issues/events{/number}",
      "events_url": "https://api.github.com/repos/reddit/reddit/events",
      "assignees_url": "https://api.github.com/repos/reddit/reddit/assignees{/user}",
      "branches_url": "https://api.github.com/repos/reddit/reddit/branches{/branch}",
      "tags_url": "https://api.github.com/repos/reddit/reddit/tags",
      "blobs_url": "https://api.github.com/repos/reddit/reddit/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/reddit/reddit/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/reddit/reddit/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/reddit/reddit/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/reddit/reddit/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/reddit/reddit/languages",
      "stargazers_url": "https://api.github.com/repos/reddit/reddit/stargazers",
      "contributors_url": "https://api.github.com/repos/reddit/reddit/contributors",
      "subscribers_url": "https://api.github.com/repos/reddit/reddit/subscribers",
      "subscription_url": "https://api.github.com/repos/reddit/reddit/subscription",
      "commits_url": "https://api.github.com/repos/reddit/reddit/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/reddit/reddit/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/reddit/reddit/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/reddit/reddit/issues/comments/{number}",
      "contents_url": "https://api.github.com/repos/reddit/reddit/contents/{+path}",
      "compare_url": "https://api.github.com/repos/reddit/reddit/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/reddit/reddit/merges",
      "archive_url": "https://api.github.com/repos/reddit/reddit/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/reddit/reddit/downloads",
      "issues_url": "https://api.github.com/repos/reddit/reddit/issues{/number}",
      "pulls_url": "https://api.github.com/repos/reddit/reddit/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/reddit/reddit/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/reddit/reddit/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/reddit/reddit/labels{/name}",
      "releases_url": "https://api.github.com/repos/reddit/reddit/releases{/id}",
      "created_at": "2008-06-18T23:30:53Z",
      "updated_at": "2014-11-13T03:27:44Z",
      "pushed_at": "2014-11-13T01:50:41Z",
      "git_url": "git://github.com/reddit/reddit.git",
      "ssh_url": "git@github.com:reddit/reddit.git",
      "clone_url": "https://github.com/reddit/reddit.git",
      "svn_url": "https://github.com/reddit/reddit",
      "homepage": "http://www.reddit.com/r/redditdev",
      "size": 50475,
      "stargazers_count": 7636,
      "watchers_count": 7636,
      "language": "Python",
      "has_issues": true,
      "has_downloads": false,
      "has_wiki": true,
      "has_pages": false,
      "forks_count": 1560,
      "mirror_url": null,
      "open_issues_count": 254,
      "forks": 1560,
      "open_issues": 254,
      "watchers": 7636,
      "default_branch": "master",
      "score": 1.0
    }
  ]
}"""
]

# Smaller, and FAKE search bodies.
# Accompanied by some zip files...
abbrev_search_bodies = [
    r"""{
  "total_count": 2,
  "incomplete_results": false,
  "items": [
    {
      "id": 20429943,
      "name": "dev",
      "full_name": "eddieantonio/dev",
      "owner": {
        "login": "eddieantonio",
        "type": "User"
      },
      "private": false,
      "html_url": "https://github.com/eddieantonio/dev",
      "description": "Dev",
      "fork": false,
      "url": "https://api.github.com/repos/eddieantonio/dev",
      "size": 29375,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 2265,
      "mirror_url": null,
      "open_issues_count": 12,
      "forks": 2265,
      "open_issues": 0,
      "watchers": 7641,
      "default_branch": "master",
      "score": 1.0
    },
    {
      "id": 20429944,
      "name": "syntax-errors-up-the-ying-yang",
      "full_name": "eddieantonio/syntax-errors-up-the-ying-yang",
      "owner": {
        "login": "eddieantonio",
        "type": "User"
      },
      "private": false,
      "html_url": "https://github.com/eddieantonio/syntax-errors-up-the-ying-yang",
      "description": "Dev",
      "fork": false,
      "url": "https://api.github.com/repos/eddieantonio/syntax-errors-up-the-ying-yang",
      "size": 29375,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 2265,
      "mirror_url": null,
      "open_issues_count": 12,
      "forks": 2265,
      "open_issues": 0,
      "watchers": 7641,
      "default_branch": "master",
      "score": 1.0
    },
    {
      "id": 20429945,
      "name": "reinhardt",
      "full_name": "django/reinhardt",
      "owner": {
        "login": "django",
        "type": "Organization"
      },
      "private": false,
      "html_url": "https://github.com/django/reinhardt",
      "description": "Dev",
      "fork": false,
      "url": "https://api.github.com/repos/django/reinhardt",
      "size": 29375,
      "language": "Python",
      "has_issues": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": true,
      "forks_count": 2265,
      "mirror_url": null,
      "open_issues_count": 12,
      "forks": 2265,
      "open_issues": 0,
      "watchers": 7641,
      "default_branch": "master",
      "score": 1.0
    }
  ]
}"""
]

# Load the FULL contents of both the real zip file and the broken zip file.
# Expose them as file-like objects.
__dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(__dir, 'dev-master.zip'), 'rb') as f:
    dev_zip = f.read()
with open(os.path.join(__dir, 'syntax-errors-up-the-ying-yang-master.zip'), 'rb') as f:
    broken_zip = f.read()
