code: def pytest_collection(session):
      config = session.config
      with catch_warnings_for_item(
          config=config, ihook=config.hook, when="collect", item=None
      ):
          yield
  
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 7 for calling a global function with example usage: pytest_collection(session) without return types