code: def clean_state(state):
      # return state dict with sizes removed
      ch = (
          [clean_state(x) for x in state[1]]
          if isinstance(state[1], list)
          else state[1]
      )
      state = (state[0], ch, {})
      return state
  
imports: import pytest
  import pyqtgraph
  import pyqtgraph.dockarea
label_desc: Use image node_id 2 for calling a global function with example usage: clean_state(state) and returns: state