def dict_of_relay_gens(relays, gens):
    """
    Create dictionaries of the gen keys from the
    relay elements
    """
    relay_gens = {k: list() for k in relays.keys()}

    for gen_name, gen in gens.items():
        gen_relay_mappings = gen['relay']
        for r in gen_relay_mappings:
            relay_gens[r].append(gen_name)

    return relay_gens