code: def _assert_raised_with_correct_stacklevel(
      actual_warning: warnings.WarningMessage,
  ) -> None:
      from inspect import (
          getframeinfo,
          stack,
      )
  
      caller = getframeinfo(stack()[4][0])
      msg = (
          "Warning not set with correct stacklevel. "
          f"File where warning is raised: {actual_warning.filename} != "
          f"{caller.filename}. Warning message: {actual_warning.message}"
      )
      assert actual_warning.filename == caller.filename, msg
  
file_path: catboost/contrib/python/pandas/py3/pandas/_testing/_warnings.py
imports: from __future__ import annotations
  from contextlib import contextmanager, nullcontext
  import re
  import sys
  from typing import Generator, Literal, Sequence, Type, cast
  import warnings
label_desc: Use image node_id 6 for calling a global function with example usage: _assert_raised_with_correct_stacklevel(actual_warning) without return types