code: def test_compatibility():
      button = Button()
      assert widget._instances[button.model_id] is button
      with pytest.deprecated_call() as record:
          assert widget._instances is widget.Widget.widgets
          assert widget._instances is widget.Widget._active_widgets
          assert widget._registry is widget.Widget.widget_types
          assert widget._registry is widget.Widget._widget_types
  
          Widget.close_all()
          assert not widget.Widget.widgets
          assert not widget.Widget._active_widgets
      caller_path = inspect.stack(context=0)[1].filename
      assert all(x.filename == caller_path for x in record)
      assert len(record) == 6
  
file_path: catboost/contrib/python/ipywidgets/py3/ipywidgets/widgets/tests/test_widget.py
imports: import inspect
  import pytest
  from IPython.core.interactiveshell import InteractiveShell
  from IPython.display import display
  from IPython.utils.capture import capture_output
  from ipywidgets.widgets import widget
  from ipywidgets.widgets.widget import Widget
  from ipywidgets.widgets.widget_button import Button
  import copy
label_desc: Use image node_id 4 for calling a global function with example usage: test_compatibility() without return types