def get_E2K_subdict(the_dict, main_key, sub_key):
    """Returns the subdictionary specified by main_key
    and sub_key, returning an empty dictionary if any is missing.
    This is for use in the post-processing functions."""
    return the_dict[main_key].get(sub_key, {}) \
        if the_dict.get(main_key) else {}