code: def mock_comm():
      _widget_attrs["_comm_default"] = getattr(
          Widget, "_comm_default", undefined
      )
      Widget._comm_default = lambda self: MockComm()
      _widget_attrs["_ipython_display_"] = Widget._ipython_display_
  
      def raise_not_implemented(*args, **kwargs):
          raise NotImplementedError()
  
      Widget._ipython_display_ = raise_not_implemented
  
      yield MockComm()
  
      for attr, value in _widget_attrs.items():
          if value is undefined:
              delattr(Widget, attr)
          else:
              setattr(Widget, attr, value)
  
file_path: vegafusion/python/vegafusion-jupyter/tests/conftest.py
imports: import pytest
  from ipykernel.comm import Comm
  from ipywidgets import Widget
label_desc: Use image node_id 1 for calling a global function with example usage: mock_comm() without return types