def get_matching_activity_dicts(query_string, search_cursor):
 collection_ids = []
 if (not search_cursor):
  (collection_ids, _) = collection_services.get_collection_ids_matching_query(query_string)
 (exp_ids, new_search_cursor) = exp_services.get_exploration_ids_matching_query(query_string, cursor=search_cursor)
 activity_list = []
 activity_list = summary_services.get_displayable_collection_summary_dicts_matching_ids(collection_ids)
 activity_list += summary_services.get_displayable_exp_summary_dicts_matching_ids(exp_ids)
 if (len(activity_list) == feconf.DEFAULT_QUERY_LIMIT):
  logging.error(('%s activities were fetched to load the library page. You may be running up against the default query limits.' % feconf.DEFAULT_QUERY_LIMIT))
 return (activity_list, new_search_cursor)

def get_matching_activity_dicts ( query_string , search_cursor ) : collection_ids = [ ] if ( not search_cursor ) : ( collection_ids , _ ) = collection_services . get_collection_ids_matching_query ( query_string ) ( exp_ids , new_search_cursor ) = exp_services . get_exploration_ids_matching_query ( query_string , cursor = search_cursor ) activity_list = [ ] activity_list = summary_services . get_displayable_collection_summary_dicts_matching_ids ( collection_ids ) activity_list += summary_services . get_displayable_exp_summary_dicts_matching_ids ( exp_ids ) if ( len ( activity_list ) == feconf . DEFAULT_QUERY_LIMIT ) : logging . error ( ( '%s activities were fetched to load the library page. You may be running up against the default query limits.' % feconf . DEFAULT_QUERY_LIMIT ) ) return ( activity_list , new_search_cursor )
given a query string and a search cursor .