code: def _issue_warning_captured(warning, hook, stacklevel):
      """
      This function should be used instead of calling ``warnings.warn`` directly when we are in the "configure" stage:
      at this point the actual options might not have been set, so we manually trigger the pytest_warning_captured
      hook so we can display this warnings in the terminal. This is a hack until we can sort out #2891.
  
      :param warning: the warning instance.
      :param hook: the hook caller
      :param stacklevel: stacklevel forwarded to warnings.warn
      """
      with warnings.catch_warnings(record=True) as records:
          warnings.simplefilter("always", type(warning))
          warnings.warn(warning, stacklevel=stacklevel)
      hook.pytest_warning_captured.call_historic(
          kwargs=dict(
              warning_message=records[0], when="config", item=None
          )
      )
  
file_path: catboost/contrib/python/pytest/py2/_pytest/warnings.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import warnings
  from contextlib import contextmanager
  import pytest
  from _pytest import compat
label_desc: Use image node_id 9 for calling a global function with example usage: _issue_warning_captured(warning, hook, stacklevel) without return types