{"action":"created","comment":{"url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/comments/145595530","pull_request_review_id":70417685,"id":145595530,"diff_hunk":"@@ -106,13 +117,74 @@ def get_random_score_ratings(user_ratings_list, num):\n         ans.append(permute_dict)\n     return ans\n \n+def reverse(edge):\n+    start = edge[0]\n+    end = edge[1]\n+    result = (end, start)\n+    return result\n+\n+def get_random_edges(user_ratings, graph, num_permutations):\n+    '''\n+    Takes in user ratings for a particular restaurant, the friend graph, and the number\n+    randomly generated permutations to create\n+    Return a list of user->list of friends dictionaries\n+    '''\n+\n+    #create the original set of edges\n+    edges = []\n+    for user in user_ratings:\n+        start = user[0]         \n+        for friend in graph[start]:\n+            e = (start, friend)\n+            edges.append(e)\n+\n+    #the list of randomized adjacency lists to return\n+    randomized_graphs = []\n+\n+    for i in range(num_permutations):\n+        randomized_edges = list(edges)\n+        #pick two random edges from the list and swap their endpoints\n+        for i in range(len(edges)):\n+            first = random.choice(randomized_edges)\n+            second = random.choice(randomized_edges)\n+            while second is first:\n+                second = random.choice(randomized_edges)\n+            new_first = (first[0], second[1])\n+            new_second = (second[0], first[1])\n+            randomized_edges.remove(first)\n+            randomized_edges.remove(second)\n+            #randomized_edges.remove(reverse(first))\n+            #randomized_edges.remove(reverse(second))\n+            randomized_edges.append(new_first)\n+            randomized_edges.append(new_second)\n+            #randomized_edges.append(reverse(new_first))\n+            #randomized_edges.append(reverse(new_second))","path":"scripts/correlation_test.py","position":91,"original_position":91,"commit_id":"d623a1eb8aa0e84ad5813ad3cbae06e966d0eb1e","original_commit_id":"d623a1eb8aa0e84ad5813ad3cbae06e966d0eb1e","user":{"login":"mzwong","id":11251542,"avatar_url":"https://avatars2.githubusercontent.com/u/11251542?v=4","gravatar_id":"","url":"https://api.github.com/users/mzwong","html_url":"https://github.com/mzwong","followers_url":"https://api.github.com/users/mzwong/followers","following_url":"https://api.github.com/users/mzwong/following{/other_user}","gists_url":"https://api.github.com/users/mzwong/gists{/gist_id}","starred_url":"https://api.github.com/users/mzwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzwong/subscriptions","organizations_url":"https://api.github.com/users/mzwong/orgs","repos_url":"https://api.github.com/users/mzwong/repos","events_url":"https://api.github.com/users/mzwong/events{/privacy}","received_events_url":"https://api.github.com/users/mzwong/received_events","type":"User","site_admin":false},"body":"Why did you comment out the randomized_edges reverse? Because don't you have two duplicate edges to resolve now?","created_at":"2017-10-19T03:56:27Z","updated_at":"2017-10-19T03:59:29Z","html_url":"https://github.com/will-gerard/yelp_research/pull/3#discussion_r145595530","pull_request_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/comments/145595530"},"html":{"href":"https://github.com/will-gerard/yelp_research/pull/3#discussion_r145595530"},"pull_request":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3","id":147462000,"html_url":"https://github.com/will-gerard/yelp_research/pull/3","diff_url":"https://github.com/will-gerard/yelp_research/pull/3.diff","patch_url":"https://github.com/will-gerard/yelp_research/pull/3.patch","issue_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/3","number":3,"state":"open","locked":false,"title":"added edge randomization method","user":{"login":"mzwong","id":11251542,"avatar_url":"https://avatars2.githubusercontent.com/u/11251542?v=4","gravatar_id":"","url":"https://api.github.com/users/mzwong","html_url":"https://github.com/mzwong","followers_url":"https://api.github.com/users/mzwong/followers","following_url":"https://api.github.com/users/mzwong/following{/other_user}","gists_url":"https://api.github.com/users/mzwong/gists{/gist_id}","starred_url":"https://api.github.com/users/mzwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzwong/subscriptions","organizations_url":"https://api.github.com/users/mzwong/orgs","repos_url":"https://api.github.com/users/mzwong/repos","events_url":"https://api.github.com/users/mzwong/events{/privacy}","received_events_url":"https://api.github.com/users/mzwong/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-19T03:54:33Z","updated_at":"2017-10-19T03:59:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e6239fb4ad19c75e8d7b6a438dc27eb78320834","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3/commits","review_comments_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3/comments","review_comment_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls/comments{/number}","comments_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/3/comments","statuses_url":"https://api.github.com/repos/will-gerard/yelp_research/statuses/d623a1eb8aa0e84ad5813ad3cbae06e966d0eb1e","head":{"label":"will-gerard:create_random_edges","ref":"create_random_edges","sha":"d623a1eb8aa0e84ad5813ad3cbae06e966d0eb1e","user":{"login":"will-gerard","id":11842945,"avatar_url":"https://avatars3.githubusercontent.com/u/11842945?v=4","gravatar_id":"","url":"https://api.github.com/users/will-gerard","html_url":"https://github.com/will-gerard","followers_url":"https://api.github.com/users/will-gerard/followers","following_url":"https://api.github.com/users/will-gerard/following{/other_user}","gists_url":"https://api.github.com/users/will-gerard/gists{/gist_id}","starred_url":"https://api.github.com/users/will-gerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-gerard/subscriptions","organizations_url":"https://api.github.com/users/will-gerard/orgs","repos_url":"https://api.github.com/users/will-gerard/repos","events_url":"https://api.github.com/users/will-gerard/events{/privacy}","received_events_url":"https://api.github.com/users/will-gerard/received_events","type":"User","site_admin":false},"repo":{"id":105201864,"name":"yelp_research","full_name":"will-gerard/yelp_research","owner":{"login":"will-gerard","id":11842945,"avatar_url":"https://avatars3.githubusercontent.com/u/11842945?v=4","gravatar_id":"","url":"https://api.github.com/users/will-gerard","html_url":"https://github.com/will-gerard","followers_url":"https://api.github.com/users/will-gerard/followers","following_url":"https://api.github.com/users/will-gerard/following{/other_user}","gists_url":"https://api.github.com/users/will-gerard/gists{/gist_id}","starred_url":"https://api.github.com/users/will-gerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-gerard/subscriptions","organizations_url":"https://api.github.com/users/will-gerard/orgs","repos_url":"https://api.github.com/users/will-gerard/repos","events_url":"https://api.github.com/users/will-gerard/events{/privacy}","received_events_url":"https://api.github.com/users/will-gerard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/will-gerard/yelp_research","description":null,"fork":false,"url":"https://api.github.com/repos/will-gerard/yelp_research","forks_url":"https://api.github.com/repos/will-gerard/yelp_research/forks","keys_url":"https://api.github.com/repos/will-gerard/yelp_research/keys{/key_id}","collaborators_url":"https://api.github.com/repos/will-gerard/yelp_research/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/will-gerard/yelp_research/teams","hooks_url":"https://api.github.com/repos/will-gerard/yelp_research/hooks","issue_events_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/events{/number}","events_url":"https://api.github.com/repos/will-gerard/yelp_research/events","assignees_url":"https://api.github.com/repos/will-gerard/yelp_research/assignees{/user}","branches_url":"https://api.github.com/repos/will-gerard/yelp_research/branches{/branch}","tags_url":"https://api.github.com/repos/will-gerard/yelp_research/tags","blobs_url":"https://api.github.com/repos/will-gerard/yelp_research/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/will-gerard/yelp_research/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/will-gerard/yelp_research/git/refs{/sha}","trees_url":"https://api.github.com/repos/will-gerard/yelp_research/git/trees{/sha}","statuses_url":"https://api.github.com/repos/will-gerard/yelp_research/statuses/{sha}","languages_url":"https://api.github.com/repos/will-gerard/yelp_research/languages","stargazers_url":"https://api.github.com/repos/will-gerard/yelp_research/stargazers","contributors_url":"https://api.github.com/repos/will-gerard/yelp_research/contributors","subscribers_url":"https://api.github.com/repos/will-gerard/yelp_research/subscribers","subscription_url":"https://api.github.com/repos/will-gerard/yelp_research/subscription","commits_url":"https://api.github.com/repos/will-gerard/yelp_research/commits{/sha}","git_commits_url":"https://api.github.com/repos/will-gerard/yelp_research/git/commits{/sha}","comments_url":"https://api.github.com/repos/will-gerard/yelp_research/comments{/number}","issue_comment_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/comments{/number}","contents_url":"https://api.github.com/repos/will-gerard/yelp_research/contents/{+path}","compare_url":"https://api.github.com/repos/will-gerard/yelp_research/compare/{base}...{head}","merges_url":"https://api.github.com/repos/will-gerard/yelp_research/merges","archive_url":"https://api.github.com/repos/will-gerard/yelp_research/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/will-gerard/yelp_research/downloads","issues_url":"https://api.github.com/repos/will-gerard/yelp_research/issues{/number}","pulls_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls{/number}","milestones_url":"https://api.github.com/repos/will-gerard/yelp_research/milestones{/number}","notifications_url":"https://api.github.com/repos/will-gerard/yelp_research/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/will-gerard/yelp_research/labels{/name}","releases_url":"https://api.github.com/repos/will-gerard/yelp_research/releases{/id}","deployments_url":"https://api.github.com/repos/will-gerard/yelp_research/deployments","created_at":"2017-09-28T21:39:33Z","updated_at":"2017-10-10T04:39:23Z","pushed_at":"2017-10-19T03:54:34Z","git_url":"git://github.com/will-gerard/yelp_research.git","ssh_url":"git@github.com:will-gerard/yelp_research.git","clone_url":"https://github.com/will-gerard/yelp_research.git","svn_url":"https://github.com/will-gerard/yelp_research","homepage":null,"size":76977,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"will-gerard:master","ref":"master","sha":"092d5d9393e507fb1b7f7a0b4bad699167991cc3","user":{"login":"will-gerard","id":11842945,"avatar_url":"https://avatars3.githubusercontent.com/u/11842945?v=4","gravatar_id":"","url":"https://api.github.com/users/will-gerard","html_url":"https://github.com/will-gerard","followers_url":"https://api.github.com/users/will-gerard/followers","following_url":"https://api.github.com/users/will-gerard/following{/other_user}","gists_url":"https://api.github.com/users/will-gerard/gists{/gist_id}","starred_url":"https://api.github.com/users/will-gerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-gerard/subscriptions","organizations_url":"https://api.github.com/users/will-gerard/orgs","repos_url":"https://api.github.com/users/will-gerard/repos","events_url":"https://api.github.com/users/will-gerard/events{/privacy}","received_events_url":"https://api.github.com/users/will-gerard/received_events","type":"User","site_admin":false},"repo":{"id":105201864,"name":"yelp_research","full_name":"will-gerard/yelp_research","owner":{"login":"will-gerard","id":11842945,"avatar_url":"https://avatars3.githubusercontent.com/u/11842945?v=4","gravatar_id":"","url":"https://api.github.com/users/will-gerard","html_url":"https://github.com/will-gerard","followers_url":"https://api.github.com/users/will-gerard/followers","following_url":"https://api.github.com/users/will-gerard/following{/other_user}","gists_url":"https://api.github.com/users/will-gerard/gists{/gist_id}","starred_url":"https://api.github.com/users/will-gerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-gerard/subscriptions","organizations_url":"https://api.github.com/users/will-gerard/orgs","repos_url":"https://api.github.com/users/will-gerard/repos","events_url":"https://api.github.com/users/will-gerard/events{/privacy}","received_events_url":"https://api.github.com/users/will-gerard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/will-gerard/yelp_research","description":null,"fork":false,"url":"https://api.github.com/repos/will-gerard/yelp_research","forks_url":"https://api.github.com/repos/will-gerard/yelp_research/forks","keys_url":"https://api.github.com/repos/will-gerard/yelp_research/keys{/key_id}","collaborators_url":"https://api.github.com/repos/will-gerard/yelp_research/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/will-gerard/yelp_research/teams","hooks_url":"https://api.github.com/repos/will-gerard/yelp_research/hooks","issue_events_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/events{/number}","events_url":"https://api.github.com/repos/will-gerard/yelp_research/events","assignees_url":"https://api.github.com/repos/will-gerard/yelp_research/assignees{/user}","branches_url":"https://api.github.com/repos/will-gerard/yelp_research/branches{/branch}","tags_url":"https://api.github.com/repos/will-gerard/yelp_research/tags","blobs_url":"https://api.github.com/repos/will-gerard/yelp_research/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/will-gerard/yelp_research/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/will-gerard/yelp_research/git/refs{/sha}","trees_url":"https://api.github.com/repos/will-gerard/yelp_research/git/trees{/sha}","statuses_url":"https://api.github.com/repos/will-gerard/yelp_research/statuses/{sha}","languages_url":"https://api.github.com/repos/will-gerard/yelp_research/languages","stargazers_url":"https://api.github.com/repos/will-gerard/yelp_research/stargazers","contributors_url":"https://api.github.com/repos/will-gerard/yelp_research/contributors","subscribers_url":"https://api.github.com/repos/will-gerard/yelp_research/subscribers","subscription_url":"https://api.github.com/repos/will-gerard/yelp_research/subscription","commits_url":"https://api.github.com/repos/will-gerard/yelp_research/commits{/sha}","git_commits_url":"https://api.github.com/repos/will-gerard/yelp_research/git/commits{/sha}","comments_url":"https://api.github.com/repos/will-gerard/yelp_research/comments{/number}","issue_comment_url":"https://api.github.com/repos/will-gerard/yelp_research/issues/comments{/number}","contents_url":"https://api.github.com/repos/will-gerard/yelp_research/contents/{+path}","compare_url":"https://api.github.com/repos/will-gerard/yelp_research/compare/{base}...{head}","merges_url":"https://api.github.com/repos/will-gerard/yelp_research/merges","archive_url":"https://api.github.com/repos/will-gerard/yelp_research/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/will-gerard/yelp_research/downloads","issues_url":"https://api.github.com/repos/will-gerard/yelp_research/issues{/number}","pulls_url":"https://api.github.com/repos/will-gerard/yelp_research/pulls{/number}","milestones_url":"https://api.github.com/repos/will-gerard/yelp_research/milestones{/number}","notifications_url":"https://api.github.com/repos/will-gerard/yelp_research/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/will-gerard/yelp_research/labels{/name}","releases_url":"https://api.github.com/repos/will-gerard/yelp_research/releases{/id}","deployments_url":"https://api.github.com/repos/will-gerard/yelp_research/deployments","created_at":"2017-09-28T21:39:33Z","updated_at":"2017-10-10T04:39:23Z","pushed_at":"2017-10-19T03:54:34Z","git_url":"git://github.com/will-gerard/yelp_research.git","ssh_url":"git@github.com:will-gerard/yelp_research.git","clone_url":"https://github.com/will-gerard/yelp_research.git","svn_url":"https://github.com/will-gerard/yelp_research","homepage":null,"size":76977,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3"},"html":{"href":"https://github.com/will-gerard/yelp_research/pull/3"},"issue":{"href":"https://api.github.com/repos/will-gerard/yelp_research/issues/3"},"comments":{"href":"https://api.github.com/repos/will-gerard/yelp_research/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/will-gerard/yelp_research/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/will-gerard/yelp_research/statuses/d623a1eb8aa0e84ad5813ad3cbae06e966d0eb1e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mzwong"}}