code: def test_set_state_dict(
      parser: OrionCmdlineParser,
      commandline: List[str],
      json_config: List[str],
      tmp_path: Path,
      json_converter,
      weird_argument: WeirdArgument,
  ):
      """Test that set_state_dict sets state properly to generate new config."""
      cmd_args = json_config
      cmd_args.extend(commandline)
  
      temp_parser: Optional[OrionCmdlineParser] = parser
      assert temp_parser is not None
      temp_parser.parse(cmd_args)
  
      state = temp_parser.get_state_dict()
      temp_parser = None
  
      blank_parser = OrionCmdlineParser(allow_non_existing_files=True)
      blank_parser.set_state_dict(state)
  
      trial = Trial(
          params=[
              {"name": "/lr", "type": "real", "value": -2.4},
              {"name": "/prior", "type": "categorical", "value": "sgd"},
              {
                  "name": "/layers/1/width",
                  "type": "integer",
                  "value": 100,
              },
              {
                  "name": "/layers/1/type",
                  "type": "categorical",
                  "value": "relu",
              },
              {
                  "name": "/layers/2/type",
                  "type": "categorical",
                  "value": "sigmoid",
              },
              {"name": "/training/lr0", "type": "real", "value": 0.032},
              {"name": "/training/mbs", "type": "integer", "value": 64},
              {
                  "name": "/something-same",
                  "type": "categorical",
                  "value": "3",
              },
              {"name": "/a.b", "type": "real", "value": 0.2},
              {
                  "name": f"/{weird_argument.name}",
                  "type": weird_argument.prior_type,
                  "value": weird_argument.value,
              },
          ]
      )
  
      output_file = str(tmp_path / "output.json")
  
      cmd_inst = blank_parser.format(output_file, trial)
  
      assert cmd_inst == [
          "--config",
          output_file,
          "--seed",
          "555",
          "--lr",
          "-2.4",
          "--non-prior",
          "choices({'sgd': 0.2, 'adam': 0.8})",
          "--prior",
          "sgd",
          "--a.b",
          "0.2",
          f"--{weird_argument.name}",
          f"{weird_argument.value}",
      ]
  
      output_data = json_converter.parse(output_file)
      assert output_data == {
          "yo": 5,
          "training": {"lr0": 0.032, "mbs": 64},
          "layers": [
              {"width": 64, "type": "relu"},
              {"width": 100, "type": "relu"},
              {"width": 16, "type": "sigmoid"},
          ],
          "something-same": "3",
      }
  
imports: import os
  from pathlib import Path
  from typing import Any, List, NamedTuple, Optional, Tuple
  import pytest
  from orion.core.io.convert import JSONConverter
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.worker.experiment import Experiment
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 28 for calling a global function with example usage: test_set_state_dict(parser, commandline, json_config, tmp_path, json_converter, weird_argument) without return types