code: def test_requires():
      @requires("lightning.app")
      def fn():
          pass
  
      fn()
  
      @requires("shouldnotexist")
      def fn_raise():
          pass
  
      with pytest.raises(
          ModuleNotFoundError,
          match="Please run: pip install 'shouldnotexist'",
      ):
          fn_raise()
  
      class ClassRaise:
          @requires("shouldnotexist")
          def __init__(self):
              pass
  
      with pytest.raises(
          ModuleNotFoundError,
          match="Please run: pip install 'shouldnotexist'",
      ):
          ClassRaise()
  
file_path: pytorch-lightning/tests/tests_app/utilities/test_imports.py
imports: import os
  from unittest import mock
  import pytest
  from lightning.app import __package_name__
  from lightning.app.utilities.imports import _get_extras, requires
label_desc: Use image node_id 2 for calling a global function with example usage: test_requires() without return types