def deprecated_call(func=None, *args, **kwargs):
__tracebackhide__ = True<EOL>if func is not None:<EOL><INDENT>args = (func,) + args<EOL><DEDENT>return warns((DeprecationWarning, PendingDeprecationWarning), *args, **kwargs)<EOL>
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.