code: def deprecated_call(func=None, *args, **kwargs):
      """context manager that can be used to ensure a block of code triggers a
      ``DeprecationWarning`` or ``PendingDeprecationWarning``::
  
          >>> import warnings
          >>> def api_call_v2():
          ...     warnings.warn('use v3 of this api', DeprecationWarning)
          ...     return 200
  
          >>> with deprecated_call():
          ...    assert api_call_v2() == 200
  
      ``deprecated_call`` can also be used by passing a function and ``*args`` and ``*kwargs``,
      in which case it will ensure calling ``func(*args, **kwargs)`` produces one of the warnings
      types above.
      """
      __tracebackhide__ = True
      if func is not None:
          args = (func,) + args
      return warns(
          (DeprecationWarning, PendingDeprecationWarning),
          *args,
          **kwargs,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import re
  import sys
  import warnings
  import six
  import _pytest._code
  from _pytest.deprecated import PYTEST_WARNS_UNKNOWN_KWARGS
  from _pytest.deprecated import WARNS_EXEC
  from _pytest.fixtures import yield_fixture
  from _pytest.outcomes import fail
label_desc: Use image node_id 2 for calling a global function with example usage: deprecated_call(func) and returns: warns