code: def test_widget_view():
      # ensure IPython shell is instantiated
      # otherwise display() just calls print
      shell = InteractiveShell.instance()
  
      with capture_output() as cap:
          w = Button()
          display(w)
  
      assert len(cap.outputs) == 1, "expect 1 output"
      mime_bundle = cap.outputs[0].data
      assert mime_bundle["text/plain"] == repr(
          w
      ), "expected plain text output"
      assert (
          "application/vnd.jupyter.widget-view+json" in mime_bundle
      ), "widget should have have a view"
      assert cap.stdout == "", repr(cap.stdout)
      assert cap.stderr == "", repr(cap.stderr)
  
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 2 for calling a global function with example usage: test_widget_view() without return types