class_docstr: UI state tracker; mirrors state from frontend SelectionService.
  
  WARNING: this component is _stateful_, and in current form implements no
  locking or access control. We recommend using this only in a single-user,
  single-threaded context such as IPython or Colab notebooks.
code: def state(self):
      return self._state
  
file_path: lit/lit_nlp/lib/ui_state.py
imports: from typing import Optional
  import attr
  from lit_nlp.api import dataset
  from lit_nlp.api import types
label_desc: Use image node_id 2 for calling the UIStateTracker obj's underlying member method code with example usage: obj.state() and returns: self