def METHOD_NAME(families):
    families_by_guid = {f['familyGuid']: dict(discoveryTags=[], **f) for f in families}
    discovery_tags = get_json_for_saved_variants(SavedVariant.objects.filter(
        family__guid__in=families_by_guid.keys(), varianttag__variant_tag_type__category='CMG Discovery Tags',
    ), add_details=True)
    gene_ids = set()
    for tag in discovery_tags:
        gene_ids.update(list(tag.get('transcripts', {}).keys()))
        for family_guid in tag['familyGuids']:
            families_by_guid[family_guid]['discoveryTags'].append(tag)
    return {
        'familiesByGuid': families_by_guid,
        'genesById': get_genes(gene_ids),
    }