code: def __getitem__(self, key: int) -> Any:
      if key not in self._data:
          block = self.blocks.blocks[key]
          if getattr(block, "stateful", False):
              self._data[key] = deepcopy(getattr(block, "value", None))
          else:
              self._data[key] = None
      return self._data[key]
  
file_path: gradio/gradio/state_holder.py
imports: from __future__ import annotations
  import threading
  from collections import OrderedDict
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any
label_desc: Use image node_id 2 for calling the SessionState obj's underlying member method code with example usage: obj.__getitem__(key) and returns: self