@gen.coroutine
def LoadSystemUsers(client):
 @gen.coroutine
 def _LoadUser(user_dict):
  identity_key = ('Email:%s' % user_dict['email'])
  identity = (yield gen.Task(Identity.Query, client, identity_key, None, must_exist=False))
  if ((identity is None) or (identity.user_id is None)):
   raise gen.Return(None)
  user = (yield gen.Task(User.Query, client, identity.user_id, None))
  raise gen.Return(user)
 global NARRATOR_USER
 NARRATOR_USER = (yield _LoadUser(_NARRATOR_USER_DICT))
 if (NARRATOR_USER is not None):
  (yield _SetWelcomeIds(NARRATOR_USER, NARRATOR_UPLOAD_PHOTOS))
  (yield _SetWelcomeIds(NARRATOR_USER, NARRATOR_UPLOAD_PHOTOS_2))
  (yield _SetWelcomeIds(NARRATOR_USER, NARRATOR_UPLOAD_PHOTOS_3))

@ gen . coroutine def LoadSystemUsers ( client ) : @ gen . coroutine def _LoadUser ( user_dict ) : identity_key = ( 'Email:%s' % user_dict [ 'email' ] ) identity = ( yield gen . Task ( Identity . Query , client , identity_key , None , must_exist = False ) ) if ( ( identity is None ) or ( identity . user_id is None ) ) : raise gen . Return ( None ) user = ( yield gen . Task ( User . Query , client , identity . user_id , None ) ) raise gen . Return ( user ) global NARRATOR_USER NARRATOR_USER = ( yield _LoadUser ( _NARRATOR_USER_DICT ) ) if ( NARRATOR_USER is not None ) : ( yield _SetWelcomeIds ( NARRATOR_USER , NARRATOR_UPLOAD_PHOTOS ) ) ( yield _SetWelcomeIds ( NARRATOR_USER , NARRATOR_UPLOAD_PHOTOS_2 ) ) ( yield _SetWelcomeIds ( NARRATOR_USER , NARRATOR_UPLOAD_PHOTOS_3 ) )
loads all system users into memory before the server starts .