code: def set_state(self, state):
      state_keys = set(
          list(state["works"].keys()) + list(state["flows"].keys())
      )
      current_state_keys = set(self.keys())
      if current_state_keys != state_keys:
          key_diff = (current_state_keys - state_keys) | (
              state_keys - current_state_keys
          )
          raise Exception(
              f"The provided state doesn't match the `Dict` {self.name}. Found `{key_diff}` un-matching keys"
          )
      for work_key, work_state in state["works"].items():
          self[work_key].set_state(work_state)
      for child_key, child_state in state["flows"].items():
          self[child_key].set_state(child_state)
  
file_path: pytorch-lightning/src/lightning/app/structures/dict.py
imports: import typing
  from lightning.app.utilities.app_helpers import _LightningAppRef, _set_child_name
label_desc: Use image node_id 9 for calling the Dict obj's underlying member method code with example usage: obj.set_state(state) without return types