code: def test_nested_order():
      with pytest.raises(AttributeError):
          # Have to set simple_2 on first
          hp = Nested()
          hp.override_from_pairs(
              [("simple_2.fun", True), ("simple_2", "on")]
          )
      # This works
      hp = Nested()
      hp.override_from_pairs(
          [("simple_2", "on"), ("simple_2.fun", True)]
      )
      assert hp == Nested.from_json(dict(simple_2=dict(fun=True)))
      # Turning on again doesn't override the values
      hp = Nested()
      hp.override_from_pairs(
          [("simple_1.fun", False), ("simple_1", "on")]
      )
      assert hp == Nested.from_json(dict(simple_1=dict(fun=False)))
      assert not hp.simple_1.fun
      with pytest.raises(TypeError):
          # simple_1.mandatory_nodefault not set
          hp.validate()
      with pytest.raises(TypeError):
          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 6 for calling a global function with example usage: test_nested_order() without return types