code: def pytest_warning_recorded(
      warning_message: "warnings.WarningMessage",
      when: "Literal['config', 'collect', 'runtest']",
      nodeid: str,
      location: Optional[Tuple[str, int, str]],
  ) -> None:
      """Process a warning captured by the internal pytest warnings plugin.
  
      :param warning_message:
          The captured warning. This is the same object produced by :py:func:`warnings.catch_warnings`, and contains
          the same attributes as the parameters of :py:func:`warnings.showwarning`.
  
      :param when:
          Indicates when the warning was captured. Possible values:
  
          * ``"config"``: during pytest configuration/initialization stage.
          * ``"collect"``: during test collection.
          * ``"runtest"``: during test execution.
  
      :param nodeid:
          Full id of the item.
  
      :param location:
          When available, holds information about the execution context of the captured
          warning (filename, linenumber, function). ``function`` evaluates to <module>
          when the execution context is at the module level.
  
      .. versionadded:: 6.0
      """
  
imports: from pathlib import Path
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Mapping
  from typing import Optional
  from typing import Sequence
  from typing import Tuple
  from typing import TYPE_CHECKING
  from typing import Union
  from pluggy import HookspecMarker
  from _pytest.deprecated import WARNING_CMDLINE_PREPARSE_HOOK
label_desc: Use image node_id 46 for calling a global function with example usage: pytest_warning_recorded(warning_message, when, nodeid, location) without return types