def _get_item(request, data):
 usage_key = UsageKey.from_string(data.get('locator'))
 item = modulestore().get_item(usage_key)
 if (not has_course_author_access(request.user, item.location.course_key)):
  raise PermissionDenied()
 return item

def _get_item ( request , data ) : usage_key = UsageKey . from_string ( data . get ( 'locator' ) ) item = modulestore ( ) . get_item ( usage_key ) if ( not has_course_author_access ( request . user , item . location . course_key ) ) : raise PermissionDenied ( ) return item
obtains from data the locator for an item .