code: def _get_recursive_state(widget, store=None, drop_defaults=False):
      """Gets the embed state of a widget, and all other widgets it refers to as well"""
      if store is None:
          store = dict()
      state = widget._get_embed_state(drop_defaults=drop_defaults)
      store[widget.model_id] = state
  
      # Loop over all values included in state (i.e. don't consider excluded values):
      for ref in _find_widget_refs_by_state(widget, state["state"]):
          if ref.model_id not in store:
              _get_recursive_state(
                  ref, store, drop_defaults=drop_defaults
              )
      return store
  
file_path: catboost/contrib/python/ipywidgets/py3/ipywidgets/embed.py
imports: import json
  import re
  from .widgets import Widget, DOMWidget, widget
  from .widgets.widget_link import Link
  from .widgets.docutils import doc_subst
  from ._version import __html_manager_version__
label_desc: Use image node_id 2 for calling a global function with example usage: _get_recursive_state(widget, store, drop_defaults) and returns: store