code: def expect_warnings(*messages, **kw):
      """Context manager which expects one or more warnings.
  
      With no arguments, squelches all SAWarnings emitted via
      sqlalchemy.util.warn and sqlalchemy.util.warn_limited.   Otherwise
      pass string expressions that will match selected warnings via regex;
      all non-matching warnings are sent through.
  
      The expect version **asserts** that the warnings were in fact seen.
  
      Note that the test suite sets SAWarning warnings to raise exceptions.
  
      """
      return _expect_warnings(Warning, messages, **kw)
  
imports: from __future__ import annotations
  import contextlib
  import re
  import sys
  from typing import Any
  from typing import Dict
  from sqlalchemy import exc
  from sqlalchemy.engine import default
  from sqlalchemy.testing.assertions import _expect_warnings
  from sqlalchemy.testing.assertions import eq_
  from sqlalchemy.testing.assertions import is_
  from sqlalchemy.testing.assertions import is_false
  from sqlalchemy.testing.assertions import is_not_
  from sqlalchemy.testing.assertions import is_true
  from sqlalchemy.testing.assertions import ne_
  from sqlalchemy.util import decorator
  from ..util import sqla_compat
label_desc: Use image node_id 12 for calling a global function with example usage: expect_warnings() and returns: _expect_warnings