{"action":"created","comment":{"url":"https://api.github.com/repos/hackupc/registration/pulls/comments/224963079","pull_request_review_id":164466807,"id":224963079,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDk2MzA3OQ==","diff_hunk":"@@ -0,0 +1,51 @@\n+import math\n+import itertools\n+from baggage.models import Room, Bag, BAG_ADDED\n+\n+\n+def calculate_distance(name, ini_x, ini_y, end_x, end_y):\n+    return ((name, end_x, end_y), math.sqrt(pow(abs(end_x - ini_x), 2) + pow(abs(end_y - ini_y), 2)))\n+\n+\n+def nearest_available(x, y):\n+    return ''\n+\n+\n+def get_positions(size_x, size_y, door_x, door_y):\n+    return list(itertools.product(list(map(str, range(0, size_x))), list(map(str, range(0, size_y)))))\n+\n+\n+def get_positions_dist(size_x, size_y, door_x, door_y, name):\n+    positions = get_positions(size_x, size_y, door_x, door_y)\n+    return list(map(lambda x: calculate_distance(name, door_x, door_y, int(x[0]), int(x[1])), positions))\n+\n+\n+def get_all_positions(rooms):\n+    return dict(map(lambda room: (room.room, get_positions(room.row, room.col, room.door_row, room.door_col)), rooms))\n+\n+\n+def get_position(special):\n+    extra = 'SPECIAL'\n+    if not special:\n+        rooms = Room.objects.all()\n+        positions = []\n+        for room in rooms:\n+            positions.extend(get_positions_dist(room.row, room.col, room.door_row, room.door_col, room.room))\n+        positions_sort = sorted(positions, key=(lambda x: x[1]))\n+        i = 0","path":"baggage/utils.py","position":null,"original_position":35,"commit_id":"12a92e046715fa1d74fe42afe3bf3dfb9cfe5351","original_commit_id":"4120bda99c044a32f78fb556f29b9ff38b3c3d63","user":{"login":"oriolclosa","id":10714286,"node_id":"MDQ6VXNlcjEwNzE0Mjg2","avatar_url":"https://avatars3.githubusercontent.com/u/10714286?v=4","gravatar_id":"","url":"https://api.github.com/users/oriolclosa","html_url":"https://github.com/oriolclosa","followers_url":"https://api.github.com/users/oriolclosa/followers","following_url":"https://api.github.com/users/oriolclosa/following{/other_user}","gists_url":"https://api.github.com/users/oriolclosa/gists{/gist_id}","starred_url":"https://api.github.com/users/oriolclosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oriolclosa/subscriptions","organizations_url":"https://api.github.com/users/oriolclosa/orgs","repos_url":"https://api.github.com/users/oriolclosa/repos","events_url":"https://api.github.com/users/oriolclosa/events{/privacy}","received_events_url":"https://api.github.com/users/oriolclosa/received_events","type":"User","site_admin":false},"body":"At first it had to be a `while`, but not now, changing to a for...","created_at":"2018-10-13T15:32:05Z","updated_at":"2018-10-13T15:32:05Z","html_url":"https://github.com/hackupc/registration/pull/31#discussion_r224963079","pull_request_url":"https://api.github.com/repos/hackupc/registration/pulls/31","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hackupc/registration/pulls/comments/224963079"},"html":{"href":"https://github.com/hackupc/registration/pull/31#discussion_r224963079"},"pull_request":{"href":"https://api.github.com/repos/hackupc/registration/pulls/31"}},"in_reply_to_id":224962500},"pull_request":{"url":"https://api.github.com/repos/hackupc/registration/pulls/31","id":207115868,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MTE1ODY4","html_url":"https://github.com/hackupc/registration/pull/31","diff_url":"https://github.com/hackupc/registration/pull/31.diff","patch_url":"https://github.com/hackupc/registration/pull/31.patch","issue_url":"https://api.github.com/repos/hackupc/registration/issues/31","number":31,"state":"open","locked":false,"title":"Baggage","user":{"login":"casassg","id":6912589,"node_id":"MDQ6VXNlcjY5MTI1ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/6912589?v=4","gravatar_id":"","url":"https://api.github.com/users/casassg","html_url":"https://github.com/casassg","followers_url":"https://api.github.com/users/casassg/followers","following_url":"https://api.github.com/users/casassg/following{/other_user}","gists_url":"https://api.github.com/users/casassg/gists{/gist_id}","starred_url":"https://api.github.com/users/casassg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casassg/subscriptions","organizations_url":"https://api.github.com/users/casassg/orgs","repos_url":"https://api.github.com/users/casassg/repos","events_url":"https://api.github.com/users/casassg/events{/privacy}","received_events_url":"https://api.github.com/users/casassg/received_events","type":"User","site_admin":false},"body":"<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines  https://github.com/HackAssistant/registration/blob/master/.github/CONTRIBUTING.md\r\n-->\r\n\r\n## What this PR does / Why we need it\r\nWork on adding Baggage checkin in backend.\r\n## Some questions\r\n- [x] I have read the contributing guidelines\r\n- [x] I abide by this repository Code of Conduct\r\n- [x] I understand that my PR won't be merged until Travis gives a \"green light\"\r\n\r\n<!--You can leave this and check them once the PR has been created.-->\r\n\r\n","created_at":"2018-08-08T19:40:26Z","updated_at":"2018-10-13T15:32:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"980119fee9d69894dcb3d36e2db6463df88ea2d5","assignee":{"login":"oriolclosa","id":10714286,"node_id":"MDQ6VXNlcjEwNzE0Mjg2","avatar_url":"https://avatars3.githubusercontent.com/u/10714286?v=4","gravatar_id":"","url":"https://api.github.com/users/oriolclosa","html_url":"https://github.com/oriolclosa","followers_url":"https://api.github.com/users/oriolclosa/followers","following_url":"https://api.github.com/users/oriolclosa/following{/other_user}","gists_url":"https://api.github.com/users/oriolclosa/gists{/gist_id}","starred_url":"https://api.github.com/users/oriolclosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oriolclosa/subscriptions","organizations_url":"https://api.github.com/users/oriolclosa/orgs","repos_url":"https://api.github.com/users/oriolclosa/repos","events_url":"https://api.github.com/users/oriolclosa/events{/privacy}","received_events_url":"https://api.github.com/users/oriolclosa/received_events","type":"User","site_admin":false},"assignees":[{"login":"oriolclosa","id":10714286,"node_id":"MDQ6VXNlcjEwNzE0Mjg2","avatar_url":"https://avatars3.githubusercontent.com/u/10714286?v=4","gravatar_id":"","url":"https://api.github.com/users/oriolclosa","html_url":"https://github.com/oriolclosa","followers_url":"https://api.github.com/users/oriolclosa/followers","following_url":"https://api.github.com/users/oriolclosa/following{/other_user}","gists_url":"https://api.github.com/users/oriolclosa/gists{/gist_id}","starred_url":"https://api.github.com/users/oriolclosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oriolclosa/subscriptions","organizations_url":"https://api.github.com/users/oriolclosa/orgs","repos_url":"https://api.github.com/users/oriolclosa/repos","events_url":"https://api.github.com/users/oriolclosa/events{/privacy}","received_events_url":"https://api.github.com/users/oriolclosa/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"ofpau","id":6532973,"node_id":"MDQ6VXNlcjY1MzI5NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/6532973?v=4","gravatar_id":"","url":"https://api.github.com/users/ofpau","html_url":"https://github.com/ofpau","followers_url":"https://api.github.com/users/ofpau/followers","following_url":"https://api.github.com/users/ofpau/following{/other_user}","gists_url":"https://api.github.com/users/ofpau/gists{/gist_id}","starred_url":"https://api.github.com/users/ofpau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofpau/subscriptions","organizations_url":"https://api.github.com/users/ofpau/orgs","repos_url":"https://api.github.com/users/ofpau/repos","events_url":"https://api.github.com/users/ofpau/events{/privacy}","received_events_url":"https://api.github.com/users/ofpau/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":755666015,"node_id":"MDU6TGFiZWw3NTU2NjYwMTU=","url":"https://api.github.com/repos/hackupc/registration/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":{"url":"https://api.github.com/repos/hackupc/registration/milestones/2","html_url":"https://github.com/hackupc/registration/milestone/2","labels_url":"https://api.github.com/repos/hackupc/registration/milestones/2/labels","id":3680551,"node_id":"MDk6TWlsZXN0b25lMzY4MDU1MQ==","number":2,"title":"Baggage","description":"","creator":{"login":"oriolclosa","id":10714286,"node_id":"MDQ6VXNlcjEwNzE0Mjg2","avatar_url":"https://avatars3.githubusercontent.com/u/10714286?v=4","gravatar_id":"","url":"https://api.github.com/users/oriolclosa","html_url":"https://github.com/oriolclosa","followers_url":"https://api.github.com/users/oriolclosa/followers","following_url":"https://api.github.com/users/oriolclosa/following{/other_user}","gists_url":"https://api.github.com/users/oriolclosa/gists{/gist_id}","starred_url":"https://api.github.com/users/oriolclosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oriolclosa/subscriptions","organizations_url":"https://api.github.com/users/oriolclosa/orgs","repos_url":"https://api.github.com/users/oriolclosa/repos","events_url":"https://api.github.com/users/oriolclosa/events{/privacy}","received_events_url":"https://api.github.com/users/oriolclosa/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2018-09-23T15:32:13Z","updated_at":"2018-10-12T22:01:00Z","due_on":"2018-10-14T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/hackupc/registration/pulls/31/commits","review_comments_url":"https://api.github.com/repos/hackupc/registration/pulls/31/comments","review_comment_url":"https://api.github.com/repos/hackupc/registration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hackupc/registration/issues/31/comments","statuses_url":"https://api.github.com/repos/hackupc/registration/statuses/12a92e046715fa1d74fe42afe3bf3dfb9cfe5351","head":{"label":"hackupc:baggage","ref":"baggage","sha":"12a92e046715fa1d74fe42afe3bf3dfb9cfe5351","user":{"login":"hackupc","id":15365910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MzY1OTEw","avatar_url":"https://avatars2.githubusercontent.com/u/15365910?v=4","gravatar_id":"","url":"https://api.github.com/users/hackupc","html_url":"https://github.com/hackupc","followers_url":"https://api.github.com/users/hackupc/followers","following_url":"https://api.github.com/users/hackupc/following{/other_user}","gists_url":"https://api.github.com/users/hackupc/gists{/gist_id}","starred_url":"https://api.github.com/users/hackupc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackupc/subscriptions","organizations_url":"https://api.github.com/users/hackupc/orgs","repos_url":"https://api.github.com/users/hackupc/repos","events_url":"https://api.github.com/users/hackupc/events{/privacy}","received_events_url":"https://api.github.com/users/hackupc/received_events","type":"Organization","site_admin":false},"repo":{"id":111384872,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEzODQ4NzI=","name":"registration","full_name":"hackupc/registration","private":false,"owner":{"login":"hackupc","id":15365910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MzY1OTEw","avatar_url":"https://avatars2.githubusercontent.com/u/15365910?v=4","gravatar_id":"","url":"https://api.github.com/users/hackupc","html_url":"https://github.com/hackupc","followers_url":"https://api.github.com/users/hackupc/followers","following_url":"https://api.github.com/users/hackupc/following{/other_user}","gists_url":"https://api.github.com/users/hackupc/gists{/gist_id}","starred_url":"https://api.github.com/users/hackupc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackupc/subscriptions","organizations_url":"https://api.github.com/users/hackupc/orgs","repos_url":"https://api.github.com/users/hackupc/repos","events_url":"https://api.github.com/users/hackupc/events{/privacy}","received_events_url":"https://api.github.com/users/hackupc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hackupc/registration","description":"✏️ Registration for HackUPC","fork":true,"url":"https://api.github.com/repos/hackupc/registration","forks_url":"https://api.github.com/repos/hackupc/registration/forks","keys_url":"https://api.github.com/repos/hackupc/registration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackupc/registration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackupc/registration/teams","hooks_url":"https://api.github.com/repos/hackupc/registration/hooks","issue_events_url":"https://api.github.com/repos/hackupc/registration/issues/events{/number}","events_url":"https://api.github.com/repos/hackupc/registration/events","assignees_url":"https://api.github.com/repos/hackupc/registration/assignees{/user}","branches_url":"https://api.github.com/repos/hackupc/registration/branches{/branch}","tags_url":"https://api.github.com/repos/hackupc/registration/tags","blobs_url":"https://api.github.com/repos/hackupc/registration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackupc/registration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackupc/registration/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackupc/registration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackupc/registration/statuses/{sha}","languages_url":"https://api.github.com/repos/hackupc/registration/languages","stargazers_url":"https://api.github.com/repos/hackupc/registration/stargazers","contributors_url":"https://api.github.com/repos/hackupc/registration/contributors","subscribers_url":"https://api.github.com/repos/hackupc/registration/subscribers","subscription_url":"https://api.github.com/repos/hackupc/registration/subscription","commits_url":"https://api.github.com/repos/hackupc/registration/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackupc/registration/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackupc/registration/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackupc/registration/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackupc/registration/contents/{+path}","compare_url":"https://api.github.com/repos/hackupc/registration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackupc/registration/merges","archive_url":"https://api.github.com/repos/hackupc/registration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackupc/registration/downloads","issues_url":"https://api.github.com/repos/hackupc/registration/issues{/number}","pulls_url":"https://api.github.com/repos/hackupc/registration/pulls{/number}","milestones_url":"https://api.github.com/repos/hackupc/registration/milestones{/number}","notifications_url":"https://api.github.com/repos/hackupc/registration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackupc/registration/labels{/name}","releases_url":"https://api.github.com/repos/hackupc/registration/releases{/id}","deployments_url":"https://api.github.com/repos/hackupc/registration/deployments","created_at":"2017-11-20T08:51:13Z","updated_at":"2018-10-12T22:46:16Z","pushed_at":"2018-10-13T15:31:34Z","git_url":"git://github.com/hackupc/registration.git","ssh_url":"git@github.com:hackupc/registration.git","clone_url":"https://github.com/hackupc/registration.git","svn_url":"https://github.com/hackupc/registration","homepage":"https://my.hackupc.com","size":5822,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":7,"watchers":4,"default_branch":"master"}},"base":{"label":"hackupc:master","ref":"master","sha":"484fbeab9c2e7dbfe32de945aebd388b089da99b","user":{"login":"hackupc","id":15365910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MzY1OTEw","avatar_url":"https://avatars2.githubusercontent.com/u/15365910?v=4","gravatar_id":"","url":"https://api.github.com/users/hackupc","html_url":"https://github.com/hackupc","followers_url":"https://api.github.com/users/hackupc/followers","following_url":"https://api.github.com/users/hackupc/following{/other_user}","gists_url":"https://api.github.com/users/hackupc/gists{/gist_id}","starred_url":"https://api.github.com/users/hackupc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackupc/subscriptions","organizations_url":"https://api.github.com/users/hackupc/orgs","repos_url":"https://api.github.com/users/hackupc/repos","events_url":"https://api.github.com/users/hackupc/events{/privacy}","received_events_url":"https://api.github.com/users/hackupc/received_events","type":"Organization","site_admin":false},"repo":{"id":111384872,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEzODQ4NzI=","name":"registration","full_name":"hackupc/registration","private":false,"owner":{"login":"hackupc","id":15365910,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MzY1OTEw","avatar_url":"https://avatars2.githubusercontent.com/u/15365910?v=4","gravatar_id":"","url":"https://api.github.com/users/hackupc","html_url":"https://github.com/hackupc","followers_url":"https://api.github.com/users/hackupc/followers","following_url":"https://api.github.com/users/hackupc/following{/other_user}","gists_url":"https://api.github.com/users/hackupc/gists{/gist_id}","starred_url":"https://api.github.com/users/hackupc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackupc/subscriptions","organizations_url":"https://api.github.com/users/hackupc/orgs","repos_url":"https://api.github.com/users/hackupc/repos","events_url":"https://api.github.com/users/hackupc/events{/privacy}","received_events_url":"https://api.github.com/users/hackupc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hackupc/registration","description":"✏️ Registration for HackUPC","fork":true,"url":"https://api.github.com/repos/hackupc/registration","forks_url":"https://api.github.com/repos/hackupc/registration/forks","keys_url":"https://api.github.com/repos/hackupc/registration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackupc/registration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackupc/registration/teams","hooks_url":"https://api.github.com/repos/hackupc/registration/hooks","issue_events_url":"https://api.github.com/repos/hackupc/registration/issues/events{/number}","events_url":"https://api.github.com/repos/hackupc/registration/events","assignees_url":"https://api.github.com/repos/hackupc/registration/assignees{/user}","branches_url":"https://api.github.com/repos/hackupc/registration/branches{/branch}","tags_url":"https://api.github.com/repos/hackupc/registration/tags","blobs_url":"https://api.github.com/repos/hackupc/registration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackupc/registration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackupc/registration/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackupc/registration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackupc/registration/statuses/{sha}","languages_url":"https://api.github.com/repos/hackupc/registration/languages","stargazers_url":"https://api.github.com/repos/hackupc/registration/stargazers","contributors_url":"https://api.github.com/repos/hackupc/registration/contributors","subscribers_url":"https://api.github.com/repos/hackupc/registration/subscribers","subscription_url":"https://api.github.com/repos/hackupc/registration/subscription","commits_url":"https://api.github.com/repos/hackupc/registration/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackupc/registration/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackupc/registration/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackupc/registration/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackupc/registration/contents/{+path}","compare_url":"https://api.github.com/repos/hackupc/registration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackupc/registration/merges","archive_url":"https://api.github.com/repos/hackupc/registration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackupc/registration/downloads","issues_url":"https://api.github.com/repos/hackupc/registration/issues{/number}","pulls_url":"https://api.github.com/repos/hackupc/registration/pulls{/number}","milestones_url":"https://api.github.com/repos/hackupc/registration/milestones{/number}","notifications_url":"https://api.github.com/repos/hackupc/registration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackupc/registration/labels{/name}","releases_url":"https://api.github.com/repos/hackupc/registration/releases{/id}","deployments_url":"https://api.github.com/repos/hackupc/registration/deployments","created_at":"2017-11-20T08:51:13Z","updated_at":"2018-10-12T22:46:16Z","pushed_at":"2018-10-13T15:31:34Z","git_url":"git://github.com/hackupc/registration.git","ssh_url":"git@github.com:hackupc/registration.git","clone_url":"https://github.com/hackupc/registration.git","svn_url":"https://github.com/hackupc/registration","homepage":"https://my.hackupc.com","size":5822,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hackupc/registration/pulls/31"},"html":{"href":"https://github.com/hackupc/registration/pull/31"},"issue":{"href":"https://api.github.com/repos/hackupc/registration/issues/31"},"comments":{"href":"https://api.github.com/repos/hackupc/registration/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/hackupc/registration/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/hackupc/registration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hackupc/registration/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/hackupc/registration/statuses/12a92e046715fa1d74fe42afe3bf3dfb9cfe5351"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"oriolclosa"}}