code: def test_nested_dict():
      hp = Nested()
      hp.override_from_json(
          {
              "simple_1": {"mandatory_nodefault": 8},
              "simple_2": {"mandatory_withdefault": "HELLO"},
          }
      )
      assert hp == Nested.from_json(
          dict(
              simple_1=dict(mandatory_nodefault=8),
              simple_2=dict(mandatory_withdefault="HELLO"),
          )
      )
      with pytest.raises(TypeError):
          hp.validate()  # simple_2.mandatory_nodefault unset
      hp.override_from_json(
          {
              "simple_2": {"mandatory_nodefault": 7},
              "simple_1": {"optional_nodefault": 55},
              "first": True,
          }
      )
      hp.validate()
      assert hp.to_json() == {
          "first": True,
          "simple_1": {
              "mandatory_nodefault": 8,
              "mandatory_withdefault": "foo",
              "optional_nodefault": 55,
              "fun": True,
          },
          "simple_2": {
              "mandatory_nodefault": 7,
              "mandatory_withdefault": "HELLO",
              "optional_nodefault": None,
              "fun": True,
          },
      }
      assert hp == hp.clone()
  
imports: from dataclasses import dataclass, field
  from typing import Optional, Dict, List, Tuple, Union
  import pytest
  from summarize_from_feedback.utils import hyperparams
label_desc: Use image node_id 5 for calling a global function with example usage: test_nested_dict() without return types