code: def test_external_imports():
      exec("from sympy import *", {})
  
      bad = []
      for mod in sys.modules:
          if "." in mod and mod.split(".")[0] in sys.modules:
              # Only worry about the top-level modules
              continue
  
          if mod in existing_modules:
              continue
  
          if any(
              mod == i or mod.startswith(i + ".")
              for i in ["sympy"]
              + hard_dependencies
              + hard_optional_dependencies
          ):
              continue
  
          if mod in sys.builtin_module_names:
              continue
  
          fname = getattr(sys.modules[mod], "__file__", None)
          if fname is None:
              bad.append(mod)
              continue
  
          if fname.endswith(
              ("__init__.py", "__init__.pyc", "__init__.pyo")
          ):
              fname = os.path.dirname(fname)
  
          if os.path.dirname(fname) in stdlib:
              continue
  
          bad.append(mod)
  
      if bad:
          raise RuntimeError(
              """Unexpected external modules found when running 'from sympy import *':
      """
              + "\n    ".join(bad)
          )
  
      print(
          "No unexpected external modules were imported with 'from sympy import *'!"
      )
  
imports: import sys
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: test_external_imports() without return types