@gen.coroutine
def ShareNew(client, obj_store, user_id, device_id, request):
 request['user_id'] = user_id
 (yield Activity.VerifyActivityId(client, user_id, device_id, request['activity']['activity_id']))
 vp_dict = request['viewpoint']
 (yield Viewpoint.VerifyViewpointId(client, user_id, device_id, vp_dict['viewpoint_id']))
 num_photos = 0
 for ep_dict in request['episodes']:
  (yield Episode.VerifyEpisodeId(client, user_id, device_id, ep_dict['new_episode_id']))
  num_photos += len(ep_dict['photo_ids'])
 _ValidateContacts(request['contacts'])
 (yield gen.Task(Operation.CreateAndExecute, client, user_id, device_id, 'ShareNewOperation.Execute', request))
 logging.info(('SHARE NEW: user: %d, device: %d, viewpoint: %s, %d episodes, %d photos' % (user_id, device_id, vp_dict['viewpoint_id'], len(request['episodes']), num_photos)))
 raise gen.Return({})

@ gen . coroutine def ShareNew ( client , obj_store , user_id , device_id , request ) : request [ 'user_id' ] = user_id ( yield Activity . VerifyActivityId ( client , user_id , device_id , request [ 'activity' ] [ 'activity_id' ] ) ) vp_dict = request [ 'viewpoint' ] ( yield Viewpoint . VerifyViewpointId ( client , user_id , device_id , vp_dict [ 'viewpoint_id' ] ) ) num_photos = 0 for ep_dict in request [ 'episodes' ] : ( yield Episode . VerifyEpisodeId ( client , user_id , device_id , ep_dict [ 'new_episode_id' ] ) ) num_photos += len ( ep_dict [ 'photo_ids' ] ) _ValidateContacts ( request [ 'contacts' ] ) ( yield gen . Task ( Operation . CreateAndExecute , client , user_id , device_id , 'ShareNewOperation.Execute' , request ) ) logging . info ( ( 'SHARE NEW: user: %d, device: %d, viewpoint: %s, %d episodes, %d photos' % ( user_id , device_id , vp_dict [ 'viewpoint_id' ] , len ( request [ 'episodes' ] ) , num_photos ) ) ) raise gen . Return ( { } )
shares a list of photos with each of a list of contacts .