code: def test_firstresult_definition(pm: PluginManager) -> None:
      class Api:
          @hookspec(firstresult=True)
          def hello(self, arg):
              "api hook 1"
  
      pm.add_hookspecs(Api)
  
      class Plugin1:
          @hookimpl
          def hello(self, arg):
              return arg + 1
  
      class Plugin2:
          @hookimpl
          def hello(self, arg):
              return arg - 1
  
      class Plugin3:
          @hookimpl
          def hello(self, arg):
              return None
  
      class Plugin4:
          @hookimpl(wrapper=True)
          def hello(self, arg):
              assert arg == 3
              outcome = yield
              assert outcome == 2
              return outcome
  
      class Plugin5:
          @hookimpl(hookwrapper=True)
          def hello(self, arg):
              assert arg == 3
              outcome = yield
              assert outcome.get_result() == 2
  
      pm.register(
          Plugin1()
      )  # discarded - not the last registered plugin
      pm.register(Plugin2())  # used as result
      pm.register(Plugin3())  # None result is ignored
      pm.register(Plugin4())  # wrapper should get same non-list result
      pm.register(
          Plugin5()
      )  # hookwrapper should get same non-list result
      res = pm.hook.hello(arg=3)
      assert res == 2
  
file_path: catboost/contrib/python/pluggy/py3/tests/test_invocations.py
imports: from typing import Iterator
  import pytest
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
label_desc: Use image node_id 5 for calling a global function with example usage: test_firstresult_definition(pm) and returns: unknown, unknown, None, outcome