code: def test_import_deepspeed_lazily():
      """Test that we are importing deepspeed only when necessary."""
      code = dedent(
          """
          import lightning.fabric
          import sys
  
          assert 'deepspeed' not in sys.modules
          from lightning.fabric.strategies import DeepSpeedStrategy
          from lightning.fabric.plugins import DeepSpeedPrecision
          assert 'deepspeed' not in sys.modules
  
          import deepspeed
          assert 'deepspeed' in sys.modules
          """
      )
      # run in complete isolation
      assert subprocess.call([sys.executable, "-c", code]) == 0
  
imports: import subprocess
  import sys
  from textwrap import dedent
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_import_deepspeed_lazily() without return types