{"action":"created","comment":{"url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/comments/103003861","pull_request_review_id":23781243,"id":103003861,"diff_hunk":"@@ -0,0 +1,65 @@\n+\"\"\"Implement a priority queue.\"\"\"\n+\n+inf = float(\"inf\")\n+\n+\n+class PikaQ(object):\n+    \"\"\"The Priority Queue Class.\n+\n+    def __init__(vals=None): Initialize a priority queue, and insert any values passed in into the Priority Queue. Must pass a list of items.\n+    def insert(item, pri=float(-inf)): Insert an item into the Priority Queue, if no priority specified, -inf will be the priority,\n+    def pop(): Remove the highest priority value from the priority queue.\n+    def peek(): Look at next item to be popped in the Priority Queue.\n+\n+\n+    \"\"\"\n+\n+    def __init__(self, vals=None):\n+        \"\"\"Initialize a priority queue.\"\"\"\n+        if vals is None:\n+            vals = []\n+        self.pq = {}\n+        if not hasattr(vals, \"__iter__\"):\n+            self.insert(vals)\n+        elif hasattr(vals, \"__iter__\"):\n+            if any(isinstance(item, dict) for item in vals):\n+                self.insert(vals)\n+            else:\n+                try:\n+                    for val, pri in vals:\n+                        self.insert(val, pri)\n+                except TypeError:\n+                    for val in vals:\n+                        self.insert(val)\n+                except ValueError:\n+                    raise ValueError(\"Submitting a string? Put it in a list or tuple first, and give it a priority! Otherwise it will be placed in the highest priority group.\")\n+\n+    def insert(self, val, pri=float(-inf)):","path":"src/pq.py","position":37,"original_position":37,"commit_id":"ec03c4bc4eadae56a1829bdfd0348b81b4ea28f6","original_commit_id":"ec03c4bc4eadae56a1829bdfd0348b81b4ea28f6","user":{"login":"nhuntwalker","id":5581888,"avatar_url":"https://avatars.githubusercontent.com/u/5581888?v=3","gravatar_id":"","url":"https://api.github.com/users/nhuntwalker","html_url":"https://github.com/nhuntwalker","followers_url":"https://api.github.com/users/nhuntwalker/followers","following_url":"https://api.github.com/users/nhuntwalker/following{/other_user}","gists_url":"https://api.github.com/users/nhuntwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/nhuntwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhuntwalker/subscriptions","organizations_url":"https://api.github.com/users/nhuntwalker/orgs","repos_url":"https://api.github.com/users/nhuntwalker/repos","events_url":"https://api.github.com/users/nhuntwalker/events{/privacy}","received_events_url":"https://api.github.com/users/nhuntwalker/received_events","type":"User","site_admin":false},"body":"wrapping this in `float` is unnecessary. The `inf` variable that you set is already a float.","created_at":"2017-02-24T18:37:29Z","updated_at":"2017-02-24T18:41:11Z","html_url":"https://github.com/Copenbacon/data-structures/pull/7#discussion_r103003861","pull_request_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/comments/103003861"},"html":{"href":"https://github.com/Copenbacon/data-structures/pull/7#discussion_r103003861"},"pull_request":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7","id":99049262,"html_url":"https://github.com/Copenbacon/data-structures/pull/7","diff_url":"https://github.com/Copenbacon/data-structures/pull/7.diff","patch_url":"https://github.com/Copenbacon/data-structures/pull/7.patch","issue_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/7","number":7,"state":"open","locked":false,"title":"Priorityq","user":{"login":"Copenbacon","id":18360407,"avatar_url":"https://avatars.githubusercontent.com/u/18360407?v=3","gravatar_id":"","url":"https://api.github.com/users/Copenbacon","html_url":"https://github.com/Copenbacon","followers_url":"https://api.github.com/users/Copenbacon/followers","following_url":"https://api.github.com/users/Copenbacon/following{/other_user}","gists_url":"https://api.github.com/users/Copenbacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Copenbacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copenbacon/subscriptions","organizations_url":"https://api.github.com/users/Copenbacon/orgs","repos_url":"https://api.github.com/users/Copenbacon/repos","events_url":"https://api.github.com/users/Copenbacon/events{/privacy}","received_events_url":"https://api.github.com/users/Copenbacon/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-22T05:11:38Z","updated_at":"2017-02-24T18:41:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7ff2210beb22f43b45c956a6608c8cf935484f3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/7/comments","statuses_url":"https://api.github.com/repos/Copenbacon/data-structures/statuses/ec03c4bc4eadae56a1829bdfd0348b81b4ea28f6","head":{"label":"Copenbacon:priorityq","ref":"priorityq","sha":"ec03c4bc4eadae56a1829bdfd0348b81b4ea28f6","user":{"login":"Copenbacon","id":18360407,"avatar_url":"https://avatars.githubusercontent.com/u/18360407?v=3","gravatar_id":"","url":"https://api.github.com/users/Copenbacon","html_url":"https://github.com/Copenbacon","followers_url":"https://api.github.com/users/Copenbacon/followers","following_url":"https://api.github.com/users/Copenbacon/following{/other_user}","gists_url":"https://api.github.com/users/Copenbacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Copenbacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copenbacon/subscriptions","organizations_url":"https://api.github.com/users/Copenbacon/orgs","repos_url":"https://api.github.com/users/Copenbacon/repos","events_url":"https://api.github.com/users/Copenbacon/events{/privacy}","received_events_url":"https://api.github.com/users/Copenbacon/received_events","type":"User","site_admin":false},"repo":{"id":76294768,"name":"data-structures","full_name":"Copenbacon/data-structures","owner":{"login":"Copenbacon","id":18360407,"avatar_url":"https://avatars.githubusercontent.com/u/18360407?v=3","gravatar_id":"","url":"https://api.github.com/users/Copenbacon","html_url":"https://github.com/Copenbacon","followers_url":"https://api.github.com/users/Copenbacon/followers","following_url":"https://api.github.com/users/Copenbacon/following{/other_user}","gists_url":"https://api.github.com/users/Copenbacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Copenbacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copenbacon/subscriptions","organizations_url":"https://api.github.com/users/Copenbacon/orgs","repos_url":"https://api.github.com/users/Copenbacon/repos","events_url":"https://api.github.com/users/Copenbacon/events{/privacy}","received_events_url":"https://api.github.com/users/Copenbacon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Copenbacon/data-structures","description":"A collection of Data Structures built from scratch in Python ","fork":false,"url":"https://api.github.com/repos/Copenbacon/data-structures","forks_url":"https://api.github.com/repos/Copenbacon/data-structures/forks","keys_url":"https://api.github.com/repos/Copenbacon/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Copenbacon/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Copenbacon/data-structures/teams","hooks_url":"https://api.github.com/repos/Copenbacon/data-structures/hooks","issue_events_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/Copenbacon/data-structures/events","assignees_url":"https://api.github.com/repos/Copenbacon/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/Copenbacon/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/Copenbacon/data-structures/tags","blobs_url":"https://api.github.com/repos/Copenbacon/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Copenbacon/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Copenbacon/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/Copenbacon/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Copenbacon/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/Copenbacon/data-structures/languages","stargazers_url":"https://api.github.com/repos/Copenbacon/data-structures/stargazers","contributors_url":"https://api.github.com/repos/Copenbacon/data-structures/contributors","subscribers_url":"https://api.github.com/repos/Copenbacon/data-structures/subscribers","subscription_url":"https://api.github.com/repos/Copenbacon/data-structures/subscription","commits_url":"https://api.github.com/repos/Copenbacon/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/Copenbacon/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/Copenbacon/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/Copenbacon/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/Copenbacon/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Copenbacon/data-structures/merges","archive_url":"https://api.github.com/repos/Copenbacon/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Copenbacon/data-structures/downloads","issues_url":"https://api.github.com/repos/Copenbacon/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/Copenbacon/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/Copenbacon/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Copenbacon/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/Copenbacon/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/Copenbacon/data-structures/deployments","created_at":"2016-12-12T20:55:51Z","updated_at":"2017-01-19T12:29:00Z","pushed_at":"2017-01-26T20:47:14Z","git_url":"git://github.com/Copenbacon/data-structures.git","ssh_url":"git@github.com:Copenbacon/data-structures.git","clone_url":"https://github.com/Copenbacon/data-structures.git","svn_url":"https://github.com/Copenbacon/data-structures","homepage":"","size":114,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"Copenbacon:master","ref":"master","sha":"c3221fdc08259a7dc1f87ad5d57dde02a554a518","user":{"login":"Copenbacon","id":18360407,"avatar_url":"https://avatars.githubusercontent.com/u/18360407?v=3","gravatar_id":"","url":"https://api.github.com/users/Copenbacon","html_url":"https://github.com/Copenbacon","followers_url":"https://api.github.com/users/Copenbacon/followers","following_url":"https://api.github.com/users/Copenbacon/following{/other_user}","gists_url":"https://api.github.com/users/Copenbacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Copenbacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copenbacon/subscriptions","organizations_url":"https://api.github.com/users/Copenbacon/orgs","repos_url":"https://api.github.com/users/Copenbacon/repos","events_url":"https://api.github.com/users/Copenbacon/events{/privacy}","received_events_url":"https://api.github.com/users/Copenbacon/received_events","type":"User","site_admin":false},"repo":{"id":76294768,"name":"data-structures","full_name":"Copenbacon/data-structures","owner":{"login":"Copenbacon","id":18360407,"avatar_url":"https://avatars.githubusercontent.com/u/18360407?v=3","gravatar_id":"","url":"https://api.github.com/users/Copenbacon","html_url":"https://github.com/Copenbacon","followers_url":"https://api.github.com/users/Copenbacon/followers","following_url":"https://api.github.com/users/Copenbacon/following{/other_user}","gists_url":"https://api.github.com/users/Copenbacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Copenbacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Copenbacon/subscriptions","organizations_url":"https://api.github.com/users/Copenbacon/orgs","repos_url":"https://api.github.com/users/Copenbacon/repos","events_url":"https://api.github.com/users/Copenbacon/events{/privacy}","received_events_url":"https://api.github.com/users/Copenbacon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Copenbacon/data-structures","description":"A collection of Data Structures built from scratch in Python ","fork":false,"url":"https://api.github.com/repos/Copenbacon/data-structures","forks_url":"https://api.github.com/repos/Copenbacon/data-structures/forks","keys_url":"https://api.github.com/repos/Copenbacon/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Copenbacon/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Copenbacon/data-structures/teams","hooks_url":"https://api.github.com/repos/Copenbacon/data-structures/hooks","issue_events_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/Copenbacon/data-structures/events","assignees_url":"https://api.github.com/repos/Copenbacon/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/Copenbacon/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/Copenbacon/data-structures/tags","blobs_url":"https://api.github.com/repos/Copenbacon/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Copenbacon/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Copenbacon/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/Copenbacon/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Copenbacon/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/Copenbacon/data-structures/languages","stargazers_url":"https://api.github.com/repos/Copenbacon/data-structures/stargazers","contributors_url":"https://api.github.com/repos/Copenbacon/data-structures/contributors","subscribers_url":"https://api.github.com/repos/Copenbacon/data-structures/subscribers","subscription_url":"https://api.github.com/repos/Copenbacon/data-structures/subscription","commits_url":"https://api.github.com/repos/Copenbacon/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/Copenbacon/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/Copenbacon/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/Copenbacon/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/Copenbacon/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/Copenbacon/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Copenbacon/data-structures/merges","archive_url":"https://api.github.com/repos/Copenbacon/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Copenbacon/data-structures/downloads","issues_url":"https://api.github.com/repos/Copenbacon/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/Copenbacon/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/Copenbacon/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/Copenbacon/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Copenbacon/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/Copenbacon/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/Copenbacon/data-structures/deployments","created_at":"2016-12-12T20:55:51Z","updated_at":"2017-01-19T12:29:00Z","pushed_at":"2017-01-26T20:47:14Z","git_url":"git://github.com/Copenbacon/data-structures.git","ssh_url":"git@github.com:Copenbacon/data-structures.git","clone_url":"https://github.com/Copenbacon/data-structures.git","svn_url":"https://github.com/Copenbacon/data-structures","homepage":"","size":114,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7"},"html":{"href":"https://github.com/Copenbacon/data-structures/pull/7"},"issue":{"href":"https://api.github.com/repos/Copenbacon/data-structures/issues/7"},"comments":{"href":"https://api.github.com/repos/Copenbacon/data-structures/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Copenbacon/data-structures/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Copenbacon/data-structures/statuses/ec03c4bc4eadae56a1829bdfd0348b81b4ea28f6"}}}}
{"actor":{"display_login":"nhuntwalker"}}