code: def embed_data(views, drop_defaults=True, state=None):
      """Gets data for embedding.
  
      Use this to get the raw data for embedding if you have special
      formatting needs.
  
      Parameters
      ----------
      {views_attribute}
      drop_defaults: boolean
          Whether to drop default values from the widget states.
      state: dict or None (default)
          The state to include. When set to None, the state of all widgets
          know to the widget manager is included. Otherwise it uses the
          passed state directly. This allows for end users to include a
          smaller state, under the responsibility that this state is
          sufficient to reconstruct the embedded views.
  
      Returns
      -------
      A dictionary with the following entries:
          manager_state: dict of the widget manager state data
          view_specs: a list of widget view specs
      """
      if views is None:
          views = [
              w
              for w in widget_module._instances.values()
              if isinstance(w, DOMWidget)
          ]
      else:
          try:
              views[0]
          except (IndexError, TypeError):
              views = [views]
  
      if state is None:
          # Get state of all known widgets
          state = Widget.get_manager_state(
              drop_defaults=drop_defaults, widgets=None
          )["state"]
  
      # Rely on ipywidget to get the default values
      json_data = Widget.get_manager_state(widgets=[])
      # but plug in our own state
      json_data["state"] = state
  
      view_specs = [w.get_view_spec() for w in views]
  
      return dict(manager_state=json_data, view_specs=view_specs)
  
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 5 for calling a global function with example usage: embed_data(views, drop_defaults, state) and returns: dict