code: def test_simple_works():
      hp = Simple()
      with pytest.raises(TypeError):
          # mandatory_nodefault not set
          hp.validate()
      with pytest.raises(TypeError):
          hp.clone()
      assert hp.fun == True
      assert hp.mandatory_withdefault == "foo"
      hp.override_from_pairs(
          [
              ("mandatory_nodefault", 3),
              ("optional_nodefault", None),
              ("fun", False),
          ]
      )
      assert hp == Simple.from_json(
          dict(
              mandatory_nodefault=3, optional_nodefault=None, fun=False
          )
      )
      hp.validate()
      assert hp == hp.clone()
      assert hp.mandatory_nodefault == 3
      assert hp.mandatory_withdefault == "foo"
      assert hp.optional_nodefault is None
      assert not hp.fun
      with pytest.raises(TypeError):
          hp.override_from_json(dict(fun=2))
  
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 1 for calling a global function with example usage: test_simple_works() without return types