code: def protect_preferred_plugins():
      """Contexts where `preferred_plugins` can be modified w/o side-effects."""
      preferred_plugins = manage_plugins.preferred_plugins.copy()
      try:
          yield
      finally:
          manage_plugins.preferred_plugins = preferred_plugins
  
file_path: scikit-image/skimage/io/tests/test_plugin.py
imports: from contextlib import contextmanager
  import numpy
  import pytest
  from skimage._shared._dependency_checks import has_mpl
  from skimage import io
  from skimage.io import manage_plugins
label_desc: Use image node_id 3 for calling a global function with example usage: protect_preferred_plugins() without return types