def expand_dict_from_defaults_and_elements(default_dict, elem_dict):
    """Expand a dictionary by copying defaults to a set of elements

    Parameters
    ----------
    default_dict : `dict`
        The defaults

    elem_dict : `dict`
        The elements

    Returns
    -------
    o_dict : `dict`
        The output dict
    """
    o_dict = {}
    for key, elem in elem_dict.items():
        o_dict[key] = default_dict.copy()
        if elem is None:
            continue
        o_dict[key].update(elem)
    return o_dict