code: def test_lazy_import_basics():
      math = lazy._lazy_import("math")
      anything_not_real = lazy._lazy_import("anything_not_real")
  
      # Now test that accessing attributes does what it should
      assert math.sin(math.pi) == pytest.approx(0, 1e-6)
      # poor-mans pytest.raises for testing errors on attribute access
      try:
          anything_not_real.pi
          assert False  # Should not get here
      except ModuleNotFoundError:
          pass
      assert isinstance(
          anything_not_real, lazy.DelayedImportErrorModule
      )
      # see if it changes for second access
      try:
          anything_not_real.pi
          assert False  # Should not get here
      except ModuleNotFoundError:
          pass
  
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 1 for calling a global function with example usage: test_lazy_import_basics() without return types