@gen.coroutine
def GetRegisteredUsers(client, last_user_id):
 if ((options.min_user_id == options.max_user_id) and (options.min_user_id != (-1))):
  if (last_user_id is None):
   result = [(yield gen.Task(User.Query, client, options.min_user_id, None))]
  else:
   result = []
 else:
  start_key = (DBKey(last_user_id, None) if (last_user_id is not None) else None)
  result = (yield gen.Task(User.Scan, client, None, excl_start_key=start_key))[0]
 users = [user for user in result if (user.IsRegistered() and (not user.IsTerminated()) and (user.email or user.phone))]
 raise gen.Return(users)

@ gen . coroutine def GetRegisteredUsers ( client , last_user_id ) : if ( ( options . min_user_id == options . max_user_id ) and ( options . min_user_id != ( - 1 ) ) ) : if ( last_user_id is None ) : result = [ ( yield gen . Task ( User . Query , client , options . min_user_id , None ) ) ] else : result = [ ] else : start_key = ( DBKey ( last_user_id , None ) if ( last_user_id is not None ) else None ) result = ( yield gen . Task ( User . Scan , client , None , excl_start_key = start_key ) ) [ 0 ] users = [ user for user in result if ( user . IsRegistered ( ) and ( not user . IsTerminated ( ) ) and ( user . email or user . phone ) ) ] raise gen . Return ( users )
get next batch of users that are registered .