{"action":"created","comment":{"url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/comments/41233817","id":41233817,"diff_hunk":"@@ -0,0 +1,136 @@\n+# -*- coding: utf-8 -*-\n+#\n+# This file is part of Invenio.\n+# Copyright (C) 2015 CERN.\n+#\n+# Invenio is free software; you can redistribute it\n+# and/or modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 2 of the\n+# License, or (at your option) any later version.\n+#\n+# Invenio is distributed in the hope that it will be\n+# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with Invenio; if not, write to the\n+# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n+# MA 02111-1307, USA.\n+#\n+# In applying this license, CERN does not\n+# waive the privileges and immunities granted to it by virtue of its status\n+# as an Intergovernmental Organization or submit itself to any jurisdiction.\n+\n+from .utils import (\n+    list_convert_to_ascii_set,\n+    dictionary_merge,\n+    dictionary_reverse\n+)\n+\n+\n+class ComputeSubproblem(object):\n+    \"\"\"Create a class representing a subproblem.\"\"\"\n+    def __init__(self, clusters_before, clusters_after,\n+                 clusters_reversed, keys_queue):\n+\n+        self.node_checked = []\n+        self.solution_before = []\n+        self.solution_after = []\n+\n+        self.check_node(keys_queue.pop(0), clusters_before, clusters_after,\n+                        clusters_reversed, keys_queue)\n+\n+    def append_children(self, node, clusters_before, clusters_after,\n+                        clusters_reversed, keys_queue):\n+        \"\"\"For the given node, find and append its children.\"\"\"\n+        if node in clusters_before.keys():\n+            self.solution_before.append(\n+                list_convert_to_ascii_set(clusters_before[node]))","path":"invenio_beard/matching/subproblems.py","position":49,"original_position":49,"commit_id":"f5bc321ee64705c39e74744445eb05d1fcb548e1","original_commit_id":"f5bc321ee64705c39e74744445eb05d1fcb548e1","user":{"login":"jacenkow","id":12476583,"avatar_url":"https://avatars.githubusercontent.com/u/12476583?v=3","gravatar_id":"","url":"https://api.github.com/users/jacenkow","html_url":"https://github.com/jacenkow","followers_url":"https://api.github.com/users/jacenkow/followers","following_url":"https://api.github.com/users/jacenkow/following{/other_user}","gists_url":"https://api.github.com/users/jacenkow/gists{/gist_id}","starred_url":"https://api.github.com/users/jacenkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacenkow/subscriptions","organizations_url":"https://api.github.com/users/jacenkow/orgs","repos_url":"https://api.github.com/users/jacenkow/repos","events_url":"https://api.github.com/users/jacenkow/events{/privacy}","received_events_url":"https://api.github.com/users/jacenkow/received_events","type":"User","site_admin":false},"body":"Elasticsearch has built-in normalisation mechanism, which converts all fields into unicode.\r\nUnfortunately Python's sets are not eligible to work in unicode and that's the way how I am avoiding ```unicode' object has no attribute (...)``` stuff.","created_at":"2015-10-06T07:49:21Z","updated_at":"2015-10-06T07:49:21Z","html_url":"https://github.com/inspirehep/invenio-beard/pull/1#discussion_r41233817","pull_request_url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/comments/41233817"},"html":{"href":"https://github.com/inspirehep/invenio-beard/pull/1#discussion_r41233817"},"pull_request":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1","id":46618141,"html_url":"https://github.com/inspirehep/invenio-beard/pull/1","diff_url":"https://github.com/inspirehep/invenio-beard/pull/1.diff","patch_url":"https://github.com/inspirehep/invenio-beard/pull/1.patch","issue_url":"https://api.github.com/repos/inspirehep/invenio-beard/issues/1","number":1,"state":"open","locked":false,"title":"WIP matching: simplex and subproblems","user":{"login":"jacenkow","id":12476583,"avatar_url":"https://avatars.githubusercontent.com/u/12476583?v=3","gravatar_id":"","url":"https://api.github.com/users/jacenkow","html_url":"https://github.com/jacenkow","followers_url":"https://api.github.com/users/jacenkow/followers","following_url":"https://api.github.com/users/jacenkow/following{/other_user}","gists_url":"https://api.github.com/users/jacenkow/gists{/gist_id}","starred_url":"https://api.github.com/users/jacenkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacenkow/subscriptions","organizations_url":"https://api.github.com/users/jacenkow/orgs","repos_url":"https://api.github.com/users/jacenkow/repos","events_url":"https://api.github.com/users/jacenkow/events{/privacy}","received_events_url":"https://api.github.com/users/jacenkow/received_events","type":"User","site_admin":false},"body":"* Add the algorithm for splitting the sets into subproblems.\r\n\r\n* Add the method solving matching problem using simplex algorithm.\r\n\r\n* Add necessary utilities for the above methods.\r\n\r\nSigned-off-by: Grzegorz Jacenków <grzegorz.jacenkow@cern.ch>","created_at":"2015-10-02T09:41:59Z","updated_at":"2015-10-06T07:49:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"350cc93533ec826752823ce6840c3731323e3697","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1/commits","review_comments_url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1/comments","review_comment_url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inspirehep/invenio-beard/issues/1/comments","statuses_url":"https://api.github.com/repos/inspirehep/invenio-beard/statuses/f5bc321ee64705c39e74744445eb05d1fcb548e1","head":{"label":"jacenkow:master","ref":"master","sha":"f5bc321ee64705c39e74744445eb05d1fcb548e1","user":{"login":"jacenkow","id":12476583,"avatar_url":"https://avatars.githubusercontent.com/u/12476583?v=3","gravatar_id":"","url":"https://api.github.com/users/jacenkow","html_url":"https://github.com/jacenkow","followers_url":"https://api.github.com/users/jacenkow/followers","following_url":"https://api.github.com/users/jacenkow/following{/other_user}","gists_url":"https://api.github.com/users/jacenkow/gists{/gist_id}","starred_url":"https://api.github.com/users/jacenkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacenkow/subscriptions","organizations_url":"https://api.github.com/users/jacenkow/orgs","repos_url":"https://api.github.com/users/jacenkow/repos","events_url":"https://api.github.com/users/jacenkow/events{/privacy}","received_events_url":"https://api.github.com/users/jacenkow/received_events","type":"User","site_admin":false},"repo":{"id":43437415,"name":"invenio-beard","full_name":"jacenkow/invenio-beard","owner":{"login":"jacenkow","id":12476583,"avatar_url":"https://avatars.githubusercontent.com/u/12476583?v=3","gravatar_id":"","url":"https://api.github.com/users/jacenkow","html_url":"https://github.com/jacenkow","followers_url":"https://api.github.com/users/jacenkow/followers","following_url":"https://api.github.com/users/jacenkow/following{/other_user}","gists_url":"https://api.github.com/users/jacenkow/gists{/gist_id}","starred_url":"https://api.github.com/users/jacenkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacenkow/subscriptions","organizations_url":"https://api.github.com/users/jacenkow/orgs","repos_url":"https://api.github.com/users/jacenkow/repos","events_url":"https://api.github.com/users/jacenkow/events{/privacy}","received_events_url":"https://api.github.com/users/jacenkow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacenkow/invenio-beard","description":"Invenio beard module","fork":true,"url":"https://api.github.com/repos/jacenkow/invenio-beard","forks_url":"https://api.github.com/repos/jacenkow/invenio-beard/forks","keys_url":"https://api.github.com/repos/jacenkow/invenio-beard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacenkow/invenio-beard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacenkow/invenio-beard/teams","hooks_url":"https://api.github.com/repos/jacenkow/invenio-beard/hooks","issue_events_url":"https://api.github.com/repos/jacenkow/invenio-beard/issues/events{/number}","events_url":"https://api.github.com/repos/jacenkow/invenio-beard/events","assignees_url":"https://api.github.com/repos/jacenkow/invenio-beard/assignees{/user}","branches_url":"https://api.github.com/repos/jacenkow/invenio-beard/branches{/branch}","tags_url":"https://api.github.com/repos/jacenkow/invenio-beard/tags","blobs_url":"https://api.github.com/repos/jacenkow/invenio-beard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacenkow/invenio-beard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacenkow/invenio-beard/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacenkow/invenio-beard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacenkow/invenio-beard/statuses/{sha}","languages_url":"https://api.github.com/repos/jacenkow/invenio-beard/languages","stargazers_url":"https://api.github.com/repos/jacenkow/invenio-beard/stargazers","contributors_url":"https://api.github.com/repos/jacenkow/invenio-beard/contributors","subscribers_url":"https://api.github.com/repos/jacenkow/invenio-beard/subscribers","subscription_url":"https://api.github.com/repos/jacenkow/invenio-beard/subscription","commits_url":"https://api.github.com/repos/jacenkow/invenio-beard/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacenkow/invenio-beard/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacenkow/invenio-beard/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacenkow/invenio-beard/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacenkow/invenio-beard/contents/{+path}","compare_url":"https://api.github.com/repos/jacenkow/invenio-beard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacenkow/invenio-beard/merges","archive_url":"https://api.github.com/repos/jacenkow/invenio-beard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacenkow/invenio-beard/downloads","issues_url":"https://api.github.com/repos/jacenkow/invenio-beard/issues{/number}","pulls_url":"https://api.github.com/repos/jacenkow/invenio-beard/pulls{/number}","milestones_url":"https://api.github.com/repos/jacenkow/invenio-beard/milestones{/number}","notifications_url":"https://api.github.com/repos/jacenkow/invenio-beard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacenkow/invenio-beard/labels{/name}","releases_url":"https://api.github.com/repos/jacenkow/invenio-beard/releases{/id}","created_at":"2015-09-30T14:21:39Z","updated_at":"2015-09-30T14:21:40Z","pushed_at":"2015-10-05T11:34:14Z","git_url":"git://github.com/jacenkow/invenio-beard.git","ssh_url":"git@github.com:jacenkow/invenio-beard.git","clone_url":"https://github.com/jacenkow/invenio-beard.git","svn_url":"https://github.com/jacenkow/invenio-beard","homepage":null,"size":109,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"inspirehep:master","ref":"master","sha":"e9737814c2caf8454c4c82314f400051d2de8591","user":{"login":"inspirehep","id":356664,"avatar_url":"https://avatars.githubusercontent.com/u/356664?v=3","gravatar_id":"","url":"https://api.github.com/users/inspirehep","html_url":"https://github.com/inspirehep","followers_url":"https://api.github.com/users/inspirehep/followers","following_url":"https://api.github.com/users/inspirehep/following{/other_user}","gists_url":"https://api.github.com/users/inspirehep/gists{/gist_id}","starred_url":"https://api.github.com/users/inspirehep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspirehep/subscriptions","organizations_url":"https://api.github.com/users/inspirehep/orgs","repos_url":"https://api.github.com/users/inspirehep/repos","events_url":"https://api.github.com/users/inspirehep/events{/privacy}","received_events_url":"https://api.github.com/users/inspirehep/received_events","type":"Organization","site_admin":false},"repo":{"id":43123882,"name":"invenio-beard","full_name":"inspirehep/invenio-beard","owner":{"login":"inspirehep","id":356664,"avatar_url":"https://avatars.githubusercontent.com/u/356664?v=3","gravatar_id":"","url":"https://api.github.com/users/inspirehep","html_url":"https://github.com/inspirehep","followers_url":"https://api.github.com/users/inspirehep/followers","following_url":"https://api.github.com/users/inspirehep/following{/other_user}","gists_url":"https://api.github.com/users/inspirehep/gists{/gist_id}","starred_url":"https://api.github.com/users/inspirehep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspirehep/subscriptions","organizations_url":"https://api.github.com/users/inspirehep/orgs","repos_url":"https://api.github.com/users/inspirehep/repos","events_url":"https://api.github.com/users/inspirehep/events{/privacy}","received_events_url":"https://api.github.com/users/inspirehep/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inspirehep/invenio-beard","description":"Invenio beard module","fork":false,"url":"https://api.github.com/repos/inspirehep/invenio-beard","forks_url":"https://api.github.com/repos/inspirehep/invenio-beard/forks","keys_url":"https://api.github.com/repos/inspirehep/invenio-beard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inspirehep/invenio-beard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inspirehep/invenio-beard/teams","hooks_url":"https://api.github.com/repos/inspirehep/invenio-beard/hooks","issue_events_url":"https://api.github.com/repos/inspirehep/invenio-beard/issues/events{/number}","events_url":"https://api.github.com/repos/inspirehep/invenio-beard/events","assignees_url":"https://api.github.com/repos/inspirehep/invenio-beard/assignees{/user}","branches_url":"https://api.github.com/repos/inspirehep/invenio-beard/branches{/branch}","tags_url":"https://api.github.com/repos/inspirehep/invenio-beard/tags","blobs_url":"https://api.github.com/repos/inspirehep/invenio-beard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inspirehep/invenio-beard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inspirehep/invenio-beard/git/refs{/sha}","trees_url":"https://api.github.com/repos/inspirehep/invenio-beard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inspirehep/invenio-beard/statuses/{sha}","languages_url":"https://api.github.com/repos/inspirehep/invenio-beard/languages","stargazers_url":"https://api.github.com/repos/inspirehep/invenio-beard/stargazers","contributors_url":"https://api.github.com/repos/inspirehep/invenio-beard/contributors","subscribers_url":"https://api.github.com/repos/inspirehep/invenio-beard/subscribers","subscription_url":"https://api.github.com/repos/inspirehep/invenio-beard/subscription","commits_url":"https://api.github.com/repos/inspirehep/invenio-beard/commits{/sha}","git_commits_url":"https://api.github.com/repos/inspirehep/invenio-beard/git/commits{/sha}","comments_url":"https://api.github.com/repos/inspirehep/invenio-beard/comments{/number}","issue_comment_url":"https://api.github.com/repos/inspirehep/invenio-beard/issues/comments{/number}","contents_url":"https://api.github.com/repos/inspirehep/invenio-beard/contents/{+path}","compare_url":"https://api.github.com/repos/inspirehep/invenio-beard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inspirehep/invenio-beard/merges","archive_url":"https://api.github.com/repos/inspirehep/invenio-beard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inspirehep/invenio-beard/downloads","issues_url":"https://api.github.com/repos/inspirehep/invenio-beard/issues{/number}","pulls_url":"https://api.github.com/repos/inspirehep/invenio-beard/pulls{/number}","milestones_url":"https://api.github.com/repos/inspirehep/invenio-beard/milestones{/number}","notifications_url":"https://api.github.com/repos/inspirehep/invenio-beard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inspirehep/invenio-beard/labels{/name}","releases_url":"https://api.github.com/repos/inspirehep/invenio-beard/releases{/id}","created_at":"2015-09-25T08:51:01Z","updated_at":"2015-09-25T09:08:05Z","pushed_at":"2015-10-05T11:34:14Z","git_url":"git://github.com/inspirehep/invenio-beard.git","ssh_url":"git@github.com:inspirehep/invenio-beard.git","clone_url":"https://github.com/inspirehep/invenio-beard.git","svn_url":"https://github.com/inspirehep/invenio-beard","homepage":null,"size":181,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1"},"html":{"href":"https://github.com/inspirehep/invenio-beard/pull/1"},"issue":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/issues/1"},"comments":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/inspirehep/invenio-beard/statuses/f5bc321ee64705c39e74744445eb05d1fcb548e1"}}}}