{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/comments/35981746","id":35981746,"diff_hunk":"@@ -14,16 +14,16 @@\n logging.basicConfig(filename='adviser_import.log', level=logging.WARNING)\n \n \n-cache = {}\n-\n-\n def cached(fn):\n-    cache[fn.__name__] = {}\n+    cache = {}\n \n     def wrapped(name):\n-        if name not in cache[fn.__name__]:\n-            cache[fn.__name__][name] = fn(name)\n-        return cache[fn.__name__][name]\n+        if name not in cache:\n+            cache[name] = fn(name)\n+        return cache[name]\n+\n+    wrapped.cache = cache\n+    wrapped.clear_cache = lambda: cache.clear()","path":"laalaa/apps/advisers/importer.py","position":34,"original_position":34,"commit_id":"047d03b6b1586b1ac9fa0d6e999e6fcdb3d6a09a","original_commit_id":"047d03b6b1586b1ac9fa0d6e999e6fcdb3d6a09a","user":{"login":"andyhd","id":35194,"avatar_url":"https://avatars.githubusercontent.com/u/35194?v=3","gravatar_id":"","url":"https://api.github.com/users/andyhd","html_url":"https://github.com/andyhd","followers_url":"https://api.github.com/users/andyhd/followers","following_url":"https://api.github.com/users/andyhd/following{/other_user}","gists_url":"https://api.github.com/users/andyhd/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhd/subscriptions","organizations_url":"https://api.github.com/users/andyhd/orgs","repos_url":"https://api.github.com/users/andyhd/repos","events_url":"https://api.github.com/users/andyhd/events{/privacy}","received_events_url":"https://api.github.com/users/andyhd/received_events","type":"User","site_admin":false},"body":"I think you can remove this `lambda` and just do `wrapped.clear_cache = cache.clear`","created_at":"2015-07-31T15:03:15Z","updated_at":"2015-07-31T15:03:15Z","html_url":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27#discussion_r35981746","pull_request_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/comments/35981746"},"html":{"href":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27#discussion_r35981746"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27","id":41252287,"html_url":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27","diff_url":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27.diff","patch_url":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27.patch","issue_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/27","number":27,"state":"open","locked":false,"title":"improved importer for advisor spreadsheet","user":{"login":"ushkarev","id":911238,"avatar_url":"https://avatars.githubusercontent.com/u/911238?v=3","gravatar_id":"","url":"https://api.github.com/users/ushkarev","html_url":"https://github.com/ushkarev","followers_url":"https://api.github.com/users/ushkarev/followers","following_url":"https://api.github.com/users/ushkarev/following{/other_user}","gists_url":"https://api.github.com/users/ushkarev/gists{/gist_id}","starred_url":"https://api.github.com/users/ushkarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ushkarev/subscriptions","organizations_url":"https://api.github.com/users/ushkarev/orgs","repos_url":"https://api.github.com/users/ushkarev/repos","events_url":"https://api.github.com/users/ushkarev/events{/privacy}","received_events_url":"https://api.github.com/users/ushkarev/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-30T16:11:32Z","updated_at":"2015-07-31T15:03:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57e9e8d024bcbd107f517ed110bb4b1748f20ba0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/27/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/statuses/047d03b6b1586b1ac9fa0d6e999e6fcdb3d6a09a","head":{"label":"ministryofjustice:feature/improving-importer","ref":"feature/improving-importer","sha":"047d03b6b1586b1ac9fa0d6e999e6fcdb3d6a09a","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":31312435,"name":"laa-legal-adviser-api","full_name":"ministryofjustice/laa-legal-adviser-api","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/laa-legal-adviser-api","description":"LAA Legal Adviser API","fork":false,"url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api","forks_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/forks","keys_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/events","assignees_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/merges","archive_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/releases{/id}","created_at":"2015-02-25T12:25:58Z","updated_at":"2015-05-05T16:19:18Z","pushed_at":"2015-07-31T14:42:47Z","git_url":"git://github.com/ministryofjustice/laa-legal-adviser-api.git","ssh_url":"git@github.com:ministryofjustice/laa-legal-adviser-api.git","clone_url":"https://github.com/ministryofjustice/laa-legal-adviser-api.git","svn_url":"https://github.com/ministryofjustice/laa-legal-adviser-api","homepage":null,"size":964,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"37413ff697962c20d731b728e94bb372a6579854","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":31312435,"name":"laa-legal-adviser-api","full_name":"ministryofjustice/laa-legal-adviser-api","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/laa-legal-adviser-api","description":"LAA Legal Adviser API","fork":false,"url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api","forks_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/forks","keys_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/events","assignees_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/merges","archive_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/releases{/id}","created_at":"2015-02-25T12:25:58Z","updated_at":"2015-05-05T16:19:18Z","pushed_at":"2015-07-31T14:42:47Z","git_url":"git://github.com/ministryofjustice/laa-legal-adviser-api.git","ssh_url":"git@github.com:ministryofjustice/laa-legal-adviser-api.git","clone_url":"https://github.com/ministryofjustice/laa-legal-adviser-api.git","svn_url":"https://github.com/ministryofjustice/laa-legal-adviser-api","homepage":null,"size":964,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27"},"html":{"href":"https://github.com/ministryofjustice/laa-legal-adviser-api/pull/27"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/27"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/laa-legal-adviser-api/statuses/047d03b6b1586b1ac9fa0d6e999e6fcdb3d6a09a"}}}}