code: def test_lazy_import_nonbuiltins():
      sp = lazy._lazy_import("scipy")
      np = lazy._lazy_import("numpy")
      if isinstance(sp, lazy.DelayedImportErrorModule):
          try:
              sp.special.erf
              assert False
          except ModuleNotFoundError:
              pass
      elif isinstance(np, lazy.DelayedImportErrorModule):
          try:
              np.sin(np.pi)
              assert False
          except ModuleNotFoundError:
              pass
      else:
          assert sp.special.erf(np.pi) == pytest.approx(1, 1e-4)
  
file_path: networkx/networkx/tests/test_lazy_imports.py
imports: import importlib
  import sys
  import types
  import pytest
  import networkx.lazy_imports
label_desc: Use image node_id 3 for calling a global function with example usage: test_lazy_import_nonbuiltins() without return types