def METHOD_NAME():
    sdfg = dace.SDFG('deepcopy_nested_sdfg')
    sdfg.add_array('A', [1], dace.int32)
    state_0 = sdfg.add_state('state_0')
    state_1 = sdfg.add_state('state_1')
    nsdfg = dace.SDFG('nested')
    nsdfg_node = state_0.add_nested_sdfg(nsdfg, None, {}, {})
    copy_nsdfg = copy.deepcopy(nsdfg_node)
    assert copy_nsdfg.sdfg.parent_nsdfg_node is copy_nsdfg
    assert copy_nsdfg.sdfg.parent is None
    assert copy_nsdfg.sdfg.parent_sdfg is None
    a = state_1.add_access('A')
    state_1.add_edge(a, None, copy_nsdfg, None, dace.Memlet())
    assert copy_nsdfg.sdfg.parent is state_1
    assert copy_nsdfg.sdfg.parent_sdfg is sdfg