code: def pytest_collection(session: "Session") -> None:
      # This hook is only called when test modules are collected
      # so for example not in the managing process of pytest-xdist
      # (which does not collect test modules).
      assertstate = session.config.stash.get(assertstate_key, None)
      if assertstate:
          if assertstate.hook is not None:
              assertstate.hook.set_session(session)
  
imports: import sys
  from typing import Any
  from typing import Generator
  from typing import List
  from typing import Optional
  from typing import TYPE_CHECKING
  from _pytest.assertion import rewrite
  from _pytest.assertion import truncate
  from _pytest.assertion import util
  from _pytest.assertion.rewrite import assertstate_key
  from _pytest.config import Config
  from _pytest.config import hookimpl
  from _pytest.config.argparsing import Parser
  from _pytest.nodes import Item
label_desc: Use image node_id 4 for calling a global function with example usage: pytest_collection(session) without return types