{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/29441730","id":29441730,"diff_hunk":"@@ -34,12 +35,473 @@ class InvalidWriteError(Exception):\n     \"\"\"\n \n \n-def chunks(items, chunk_size):\n+def _all_usage_keys(descriptors, aside_types):\n     \"\"\"\n-    Yields the values from items in chunks of size chunk_size\n+    Return a set of all usage_ids for the descriptors that this FieldDataCache is caching\n+    against, and well as all asides for those descriptors.\n     \"\"\"\n-    items = list(items)\n-    return (items[i:i + chunk_size] for i in xrange(0, len(items), chunk_size))\n+    usage_ids = set()\n+    for descriptor in descriptors:\n+        usage_ids.add(descriptor.scope_ids.usage_id)\n+\n+        for aside_type in aside_types:\n+            usage_ids.add(AsideUsageKeyV1(descriptor.scope_ids.usage_id, aside_type))\n+\n+    return usage_ids\n+\n+\n+def _all_block_types(descriptors, aside_types):\n+    \"\"\"\n+    Return a set of all block_types that are cached by this FieldDataCache.","path":"lms/djangoapps/courseware/model_data.py","position":53,"original_position":53,"commit_id":"4128ccaea39dfc61dfa3c8b625916535d0104531","original_commit_id":"4128ccaea39dfc61dfa3c8b625916535d0104531","user":{"login":"doctoryes","id":7285237,"avatar_url":"https://avatars.githubusercontent.com/u/7285237?v=3","gravatar_id":"","url":"https://api.github.com/users/doctoryes","html_url":"https://github.com/doctoryes","followers_url":"https://api.github.com/users/doctoryes/followers","following_url":"https://api.github.com/users/doctoryes/following{/other_user}","gists_url":"https://api.github.com/users/doctoryes/gists{/gist_id}","starred_url":"https://api.github.com/users/doctoryes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctoryes/subscriptions","organizations_url":"https://api.github.com/users/doctoryes/orgs","repos_url":"https://api.github.com/users/doctoryes/repos","events_url":"https://api.github.com/users/doctoryes/events{/privacy}","received_events_url":"https://api.github.com/users/doctoryes/received_events","type":"User","site_admin":false},"body":"This docstring should be changed to be similar to the one above.","created_at":"2015-04-30T15:48:33Z","updated_at":"2015-04-30T15:48:33Z","html_url":"https://github.com/edx/edx-platform/pull/7789#discussion_r29441730","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/7789","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/29441730"},"html":{"href":"https://github.com/edx/edx-platform/pull/7789#discussion_r29441730"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7789"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/7789","id":33964061,"html_url":"https://github.com/edx/edx-platform/pull/7789","diff_url":"https://github.com/edx/edx-platform/pull/7789.diff","patch_url":"https://github.com/edx/edx-platform/pull/7789.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/7789","number":7789,"state":"open","locked":false,"title":"Wrap access to CSM (inside FieldDataCache) to use the new interface","user":{"login":"cpennington","id":30236,"avatar_url":"https://avatars.githubusercontent.com/u/30236?v=3","gravatar_id":"","url":"https://api.github.com/users/cpennington","html_url":"https://github.com/cpennington","followers_url":"https://api.github.com/users/cpennington/followers","following_url":"https://api.github.com/users/cpennington/following{/other_user}","gists_url":"https://api.github.com/users/cpennington/gists{/gist_id}","starred_url":"https://api.github.com/users/cpennington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpennington/subscriptions","organizations_url":"https://api.github.com/users/cpennington/orgs","repos_url":"https://api.github.com/users/cpennington/repos","events_url":"https://api.github.com/users/cpennington/events{/privacy}","received_events_url":"https://api.github.com/users/cpennington/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-23T15:01:35Z","updated_at":"2015-04-30T15:48:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24372003211b65a991bc003c818b4faf49147cec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/7789/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/7789/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/7789/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/4128ccaea39dfc61dfa3c8b625916535d0104531","head":{"label":"cpennington:wrap-csm","ref":"wrap-csm","sha":"4128ccaea39dfc61dfa3c8b625916535d0104531","user":{"login":"cpennington","id":30236,"avatar_url":"https://avatars.githubusercontent.com/u/30236?v=3","gravatar_id":"","url":"https://api.github.com/users/cpennington","html_url":"https://github.com/cpennington","followers_url":"https://api.github.com/users/cpennington/followers","following_url":"https://api.github.com/users/cpennington/following{/other_user}","gists_url":"https://api.github.com/users/cpennington/gists{/gist_id}","starred_url":"https://api.github.com/users/cpennington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpennington/subscriptions","organizations_url":"https://api.github.com/users/cpennington/orgs","repos_url":"https://api.github.com/users/cpennington/repos","events_url":"https://api.github.com/users/cpennington/events{/privacy}","received_events_url":"https://api.github.com/users/cpennington/received_events","type":"User","site_admin":false},"repo":{"id":10688258,"name":"edx-platform","full_name":"cpennington/edx-platform","owner":{"login":"cpennington","id":30236,"avatar_url":"https://avatars.githubusercontent.com/u/30236?v=3","gravatar_id":"","url":"https://api.github.com/users/cpennington","html_url":"https://github.com/cpennington","followers_url":"https://api.github.com/users/cpennington/followers","following_url":"https://api.github.com/users/cpennington/following{/other_user}","gists_url":"https://api.github.com/users/cpennington/gists{/gist_id}","starred_url":"https://api.github.com/users/cpennington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpennington/subscriptions","organizations_url":"https://api.github.com/users/cpennington/orgs","repos_url":"https://api.github.com/users/cpennington/repos","events_url":"https://api.github.com/users/cpennington/events{/privacy}","received_events_url":"https://api.github.com/users/cpennington/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cpennington/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/cpennington/edx-platform","forks_url":"https://api.github.com/repos/cpennington/edx-platform/forks","keys_url":"https://api.github.com/repos/cpennington/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cpennington/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cpennington/edx-platform/teams","hooks_url":"https://api.github.com/repos/cpennington/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/cpennington/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/cpennington/edx-platform/events","assignees_url":"https://api.github.com/repos/cpennington/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/cpennington/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/cpennington/edx-platform/tags","blobs_url":"https://api.github.com/repos/cpennington/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cpennington/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cpennington/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/cpennington/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cpennington/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/cpennington/edx-platform/languages","stargazers_url":"https://api.github.com/repos/cpennington/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/cpennington/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/cpennington/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/cpennington/edx-platform/subscription","commits_url":"https://api.github.com/repos/cpennington/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/cpennington/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/cpennington/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/cpennington/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/cpennington/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/cpennington/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cpennington/edx-platform/merges","archive_url":"https://api.github.com/repos/cpennington/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cpennington/edx-platform/downloads","issues_url":"https://api.github.com/repos/cpennington/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/cpennington/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/cpennington/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/cpennington/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cpennington/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/cpennington/edx-platform/releases{/id}","created_at":"2013-06-14T12:13:54Z","updated_at":"2015-04-06T13:52:11Z","pushed_at":"2015-04-30T13:24:55Z","git_url":"git://github.com/cpennington/edx-platform.git","ssh_url":"git@github.com:cpennington/edx-platform.git","clone_url":"https://github.com/cpennington/edx-platform.git","svn_url":"https://github.com/cpennington/edx-platform","homepage":"http://code.edx.org/","size":394749,"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":"edx:master","ref":"master","sha":"d9e13d22b8f5acd512b8b98dca17e610d1698890","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-04-30T15:04:50Z","pushed_at":"2015-04-30T15:34:07Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1909780,"stargazers_count":1903,"watchers_count":1903,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1083,"mirror_url":null,"open_issues_count":164,"forks":1083,"open_issues":164,"watchers":1903,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7789"},"html":{"href":"https://github.com/edx/edx-platform/pull/7789"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7789"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7789/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7789/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7789/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/4128ccaea39dfc61dfa3c8b625916535d0104531"}}}}