def deepcopy_nested_dict(nested_dict_to_deepcopy: dict):
    """
    Deepcopy of a nested dictionary of two levels, e.g. {k1:{...}, k2:{...}, ..., kN:{...}}
    :param nested_dict_to_deepcopy: The nested dictionary to return a deepcopy of
    :return: A deepcopy of a nested dictionary
    """
    # Copy the upper level
    deepcopied_nested_dict = nested_dict_to_deepcopy.copy()

    # Coppy the lower level
    for k, d in nested_dict_to_deepcopy.items():
        assert type(d) is dict
        deepcopied_nested_dict[k] = d.copy()

    return deepcopied_nested_dict