code: def import_all_but_wx(
      name,
      globals=builtins.globals(),
      locals=builtins.locals(),
      fromlist=[],
      level=0,
      default_import=builtins.__import__,
  ):
      if name == "wx" or name.startswith("wx."):
          raise ImportError("Not allowed to import wx!")
      return default_import(name, globals, locals, fromlist, level)
  
file_path: CellProfiler/tests/frontend/test_nowx.py
imports: import builtins
  import sys
  import tempfile
  import unittest
  from urllib.request import urlopen
  from tests.frontend.modules import example_images_directory, get_test_resources_directory
label_desc: Use image node_id 1 for calling a global function with example usage: import_all_but_wx(name, globals, locals, fromlist, level, default_import) and returns: default_import