def _load_preview_module(request, descriptor):
 student_data = KvsFieldData(SessionKeyValueStore(request))
 if has_author_view(descriptor):
  wrapper = partial(CmsFieldData, student_data=student_data)
 else:
  wrapper = partial(LmsFieldData, student_data=student_data)
 wrapped_field_data = wrapper(descriptor._field_data)
 preview_runtime = _preview_module_system(request, descriptor, wrapped_field_data)
 descriptor.bind_for_student(preview_runtime, request.user.id, [wrapper])
 return descriptor

def _load_preview_module ( request , descriptor ) : student_data = KvsFieldData ( SessionKeyValueStore ( request ) ) if has_author_view ( descriptor ) : wrapper = partial ( CmsFieldData , student_data = student_data ) else : wrapper = partial ( LmsFieldData , student_data = student_data ) wrapped_field_data = wrapper ( descriptor . _field_data ) preview_runtime = _preview_module_system ( request , descriptor , wrapped_field_data ) descriptor . bind_for_student ( preview_runtime , request . user . id , [ wrapper ] ) return descriptor
return a preview xmodule instantiated from the supplied descriptor .