def get_nested_dict(parent_dict, map_key):
    """
    Helper function fetching dictionary from another dictionary in which it is
    referenced. If the key is not known to the parent a new dictionary
    is created and assigned.

    :param parent_dict: The map containing the other dictionary.
    :type parent_dict: :class:`dict`

    :param map_key: The key for the dict to be fetched.
    :type map_key: any suitable key
    """
    if parent_dict.has_key(map_key):
        return parent_dict[map_key]
    child_dict = dict()
    parent_dict[map_key] = child_dict
    return child_dict