human
I wrote the below code

    language_codes_suffix = ''
    if language_codes:
        language_codes_suffix = ('    language_code=("%s")' % '"    OR    "'.join(language_codes))
    def _generate_query(categories):
        return ('category=("%s")%s' % ('"    OR    "'.join(categories), language_codes_suffix))
    all_collection_ids = []
    header_id_to_collection_ids = {}
    for group in _LIBRARY_INDEX_GROUPS:
        collection_ids = collection_services.search_collections(_generate_query(group['search_categories']), 8)[0]
        header_id_to_collection_ids[group['header_i18n_id']] = collection_ids
        all_collection_ids += collection_ids
    collection_summaries = [summary for summary in collection_services.get_collection_summaries_matching_ids(all_collection_ids) if (summary is not None)]
    collection_summary_dicts = {summary_dict['id']: summary_dict for summary_dict in _get_displayable_collection_summary_dicts(collection_summaries)}
    all_exp_ids = []
    header_to_exp_ids = {}
    for group in _LIBRARY_INDEX_GROUPS:
        exp_ids = exp_services.search_explorations(_generate_query(group['search_categories']), 8)[0]
        header_to_exp_ids[group['header_i18n_id']] = exp_ids
        all_exp_ids += exp_ids
    exp_summaries = [summary for summary in exp_services.get_exploration_summaries_matching_ids(all_exp_ids) if (summary is not None)]
    exp_summary_dicts = {summary_dict['id']: summary_dict for summary_dict in get_displayable_exp_summary_dicts(exp_summaries)}
    results = []
    for group in _LIBRARY_INDEX_GROUPS:
        summary_dicts = []
        collection_ids_to_display = header_id_to_collection_ids[group['header_i18n_id']]
        summary_dicts = [collection_summary_dicts[collection_id] for collection_id in collection_ids_to_display if (collection_id in collection_summary_dicts)]
        exp_ids_to_display = header_to_exp_ids[group['header_i18n_id']]
        summary_dicts += [exp_summary_dicts[exp_id] for exp_id in exp_ids_to_display if (exp_id in exp_summary_dicts)]
        if (not summary_dicts):
         ...

What's a good function header?
assistant
#Here is Python program to fix = ''
.

def get_library_groups(language_codes):