{"action":"created","comment":{"url":"https://api.github.com/repos/Koozco/pmp/pulls/comments/234440088","pull_request_review_id":176085416,"id":234440088,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDQ0MDA4OA==","diff_hunk":"@@ -0,0 +1,119 @@\n+import numpy as np\n+from itertools import combinations, product, chain\n+from operator import itemgetter\n+\n+from .rule import Rule\n+from _common import solve_methods_registry\n+from utils.ilp import *\n+\n+algorithm = solve_methods_registry()\n+\n+\n+class ChamberlinCourant(Rule):\n+    \"\"\"Chamberlin-Courant vote scoring rule.\"\"\"\n+\n+    methods = algorithm.registry\n+\n+    def __init__(self, weights=None):\n+        Rule.__init__(self)\n+        self.weights = weights\n+        self.scores = {}\n+\n+    def find_committee(self, k, profile, method=None):\n+        self.scores = {}\n+        if self.weights is None:\n+            self.weights = self._borda_weights(len(profile.candidates))\n+\n+        if method is None:\n+            committee = algorithm.registry.default(self, k, profile)\n+        else:\n+            committee = algorithm.registry.all[method](self, k, profile)\n+        return committee\n+\n+    @algorithm('Bruteforce', 'Exponential.', True)\n+    def _brute(self, k, profile):\n+        self.scores = self.compute_scores(k, profile)\n+        return max(self.scores.iteritems(), key=itemgetter(1))[0]","path":"rules/chamberlin_courant.py","position":null,"original_position":36,"commit_id":"5866bfb177525e2f4386acacdff12f60456cbb0f","original_commit_id":"e45688e71fa96fb710eba3c1b19aae106441c0d3","user":{"login":"katabana","id":23458038,"node_id":"MDQ6VXNlcjIzNDU4MDM4","avatar_url":"https://avatars1.githubusercontent.com/u/23458038?v=4","gravatar_id":"","url":"https://api.github.com/users/katabana","html_url":"https://github.com/katabana","followers_url":"https://api.github.com/users/katabana/followers","following_url":"https://api.github.com/users/katabana/following{/other_user}","gists_url":"https://api.github.com/users/katabana/gists{/gist_id}","starred_url":"https://api.github.com/users/katabana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katabana/subscriptions","organizations_url":"https://api.github.com/users/katabana/orgs","repos_url":"https://api.github.com/users/katabana/repos","events_url":"https://api.github.com/users/katabana/events{/privacy}","received_events_url":"https://api.github.com/users/katabana/received_events","type":"User","site_admin":false},"body":"Naprawiłam","created_at":"2018-11-18T11:32:45Z","updated_at":"2018-11-18T11:32:45Z","html_url":"https://github.com/Koozco/pmp/pull/12#discussion_r234440088","pull_request_url":"https://api.github.com/repos/Koozco/pmp/pulls/12","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/comments/234440088"},"html":{"href":"https://github.com/Koozco/pmp/pull/12#discussion_r234440088"},"pull_request":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/12"}},"in_reply_to_id":234439374},"pull_request":{"url":"https://api.github.com/repos/Koozco/pmp/pulls/12","id":231765507,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzY1NTA3","html_url":"https://github.com/Koozco/pmp/pull/12","diff_url":"https://github.com/Koozco/pmp/pull/12.diff","patch_url":"https://github.com/Koozco/pmp/pull/12.patch","issue_url":"https://api.github.com/repos/Koozco/pmp/issues/12","number":12,"state":"open","locked":false,"title":"Rule: Chamberlin-Courant ","user":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"body":"Implementation of Chamberlin-Courant rule.\r\nAdditionaly, introduces method for rule algorithms introspection.","created_at":"2018-11-18T03:10:55Z","updated_at":"2018-11-18T11:32:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edeffce67363aa3b811c32d07ef31f542e8a5889","assignee":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"assignees":[{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Koozco/pmp/pulls/12/commits","review_comments_url":"https://api.github.com/repos/Koozco/pmp/pulls/12/comments","review_comment_url":"https://api.github.com/repos/Koozco/pmp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Koozco/pmp/issues/12/comments","statuses_url":"https://api.github.com/repos/Koozco/pmp/statuses/5866bfb177525e2f4386acacdff12f60456cbb0f","head":{"label":"Koozco:rule/chamberlin_courant","ref":"rule/chamberlin_courant","sha":"5866bfb177525e2f4386acacdff12f60456cbb0f","user":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"repo":{"id":129810143,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk4MTAxNDM=","name":"pmp","full_name":"Koozco/pmp","private":false,"owner":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Koozco/pmp","description":null,"fork":false,"url":"https://api.github.com/repos/Koozco/pmp","forks_url":"https://api.github.com/repos/Koozco/pmp/forks","keys_url":"https://api.github.com/repos/Koozco/pmp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Koozco/pmp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Koozco/pmp/teams","hooks_url":"https://api.github.com/repos/Koozco/pmp/hooks","issue_events_url":"https://api.github.com/repos/Koozco/pmp/issues/events{/number}","events_url":"https://api.github.com/repos/Koozco/pmp/events","assignees_url":"https://api.github.com/repos/Koozco/pmp/assignees{/user}","branches_url":"https://api.github.com/repos/Koozco/pmp/branches{/branch}","tags_url":"https://api.github.com/repos/Koozco/pmp/tags","blobs_url":"https://api.github.com/repos/Koozco/pmp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Koozco/pmp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Koozco/pmp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Koozco/pmp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Koozco/pmp/statuses/{sha}","languages_url":"https://api.github.com/repos/Koozco/pmp/languages","stargazers_url":"https://api.github.com/repos/Koozco/pmp/stargazers","contributors_url":"https://api.github.com/repos/Koozco/pmp/contributors","subscribers_url":"https://api.github.com/repos/Koozco/pmp/subscribers","subscription_url":"https://api.github.com/repos/Koozco/pmp/subscription","commits_url":"https://api.github.com/repos/Koozco/pmp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Koozco/pmp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Koozco/pmp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Koozco/pmp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Koozco/pmp/contents/{+path}","compare_url":"https://api.github.com/repos/Koozco/pmp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Koozco/pmp/merges","archive_url":"https://api.github.com/repos/Koozco/pmp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Koozco/pmp/downloads","issues_url":"https://api.github.com/repos/Koozco/pmp/issues{/number}","pulls_url":"https://api.github.com/repos/Koozco/pmp/pulls{/number}","milestones_url":"https://api.github.com/repos/Koozco/pmp/milestones{/number}","notifications_url":"https://api.github.com/repos/Koozco/pmp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Koozco/pmp/labels{/name}","releases_url":"https://api.github.com/repos/Koozco/pmp/releases{/id}","deployments_url":"https://api.github.com/repos/Koozco/pmp/deployments","created_at":"2018-04-16T21:49:37Z","updated_at":"2018-04-22T19:53:14Z","pushed_at":"2018-11-18T11:28:56Z","git_url":"git://github.com/Koozco/pmp.git","ssh_url":"git@github.com:Koozco/pmp.git","clone_url":"https://github.com/Koozco/pmp.git","svn_url":"https://github.com/Koozco/pmp","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Koozco:feature/ilp","ref":"feature/ilp","sha":"089c975257ccf3f44592382b19dae1d0e9fe138d","user":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"repo":{"id":129810143,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk4MTAxNDM=","name":"pmp","full_name":"Koozco/pmp","private":false,"owner":{"login":"Koozco","id":16130342,"node_id":"MDQ6VXNlcjE2MTMwMzQy","avatar_url":"https://avatars0.githubusercontent.com/u/16130342?v=4","gravatar_id":"","url":"https://api.github.com/users/Koozco","html_url":"https://github.com/Koozco","followers_url":"https://api.github.com/users/Koozco/followers","following_url":"https://api.github.com/users/Koozco/following{/other_user}","gists_url":"https://api.github.com/users/Koozco/gists{/gist_id}","starred_url":"https://api.github.com/users/Koozco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Koozco/subscriptions","organizations_url":"https://api.github.com/users/Koozco/orgs","repos_url":"https://api.github.com/users/Koozco/repos","events_url":"https://api.github.com/users/Koozco/events{/privacy}","received_events_url":"https://api.github.com/users/Koozco/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Koozco/pmp","description":null,"fork":false,"url":"https://api.github.com/repos/Koozco/pmp","forks_url":"https://api.github.com/repos/Koozco/pmp/forks","keys_url":"https://api.github.com/repos/Koozco/pmp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Koozco/pmp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Koozco/pmp/teams","hooks_url":"https://api.github.com/repos/Koozco/pmp/hooks","issue_events_url":"https://api.github.com/repos/Koozco/pmp/issues/events{/number}","events_url":"https://api.github.com/repos/Koozco/pmp/events","assignees_url":"https://api.github.com/repos/Koozco/pmp/assignees{/user}","branches_url":"https://api.github.com/repos/Koozco/pmp/branches{/branch}","tags_url":"https://api.github.com/repos/Koozco/pmp/tags","blobs_url":"https://api.github.com/repos/Koozco/pmp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Koozco/pmp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Koozco/pmp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Koozco/pmp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Koozco/pmp/statuses/{sha}","languages_url":"https://api.github.com/repos/Koozco/pmp/languages","stargazers_url":"https://api.github.com/repos/Koozco/pmp/stargazers","contributors_url":"https://api.github.com/repos/Koozco/pmp/contributors","subscribers_url":"https://api.github.com/repos/Koozco/pmp/subscribers","subscription_url":"https://api.github.com/repos/Koozco/pmp/subscription","commits_url":"https://api.github.com/repos/Koozco/pmp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Koozco/pmp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Koozco/pmp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Koozco/pmp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Koozco/pmp/contents/{+path}","compare_url":"https://api.github.com/repos/Koozco/pmp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Koozco/pmp/merges","archive_url":"https://api.github.com/repos/Koozco/pmp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Koozco/pmp/downloads","issues_url":"https://api.github.com/repos/Koozco/pmp/issues{/number}","pulls_url":"https://api.github.com/repos/Koozco/pmp/pulls{/number}","milestones_url":"https://api.github.com/repos/Koozco/pmp/milestones{/number}","notifications_url":"https://api.github.com/repos/Koozco/pmp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Koozco/pmp/labels{/name}","releases_url":"https://api.github.com/repos/Koozco/pmp/releases{/id}","deployments_url":"https://api.github.com/repos/Koozco/pmp/deployments","created_at":"2018-04-16T21:49:37Z","updated_at":"2018-04-22T19:53:14Z","pushed_at":"2018-11-18T11:28:56Z","git_url":"git://github.com/Koozco/pmp.git","ssh_url":"git@github.com:Koozco/pmp.git","clone_url":"https://github.com/Koozco/pmp.git","svn_url":"https://github.com/Koozco/pmp","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/12"},"html":{"href":"https://github.com/Koozco/pmp/pull/12"},"issue":{"href":"https://api.github.com/repos/Koozco/pmp/issues/12"},"comments":{"href":"https://api.github.com/repos/Koozco/pmp/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Koozco/pmp/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/Koozco/pmp/statuses/5866bfb177525e2f4386acacdff12f60456cbb0f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"katabana"}}