code: def _is_unexpected_warning(
      actual_warning: warnings.WarningMessage,
      expected_warning: type[Warning]
      | bool
      | tuple[type[Warning], ...]
      | None,
  ) -> bool:
      """Check if the actual warning issued is unexpected."""
      if actual_warning and not expected_warning:
          return True
      expected_warning = cast(Type[Warning], expected_warning)
      return bool(
          not issubclass(actual_warning.category, expected_warning)
      )
  
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 5 for calling a global function with example usage: _is_unexpected_warning(actual_warning, expected_warning) and returns: bool, True