@contextlib.contextmanager<EOL>def _check_py3k_warnings(*filters, **kwargs):
if sys.py3kwarning:<EOL><INDENT>if not filters:<EOL><INDENT>filters = (("<STR_LIT>", DeprecationWarning),)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>filters = ()<EOL><DEDENT>return _filterwarnings(filters, kwargs.get('<STR_LIT>'))<EOL>
Context manager to silence py3k warnings.

    Accept 2-tuples as positional arguments:
        ("message regexp", WarningCategory)

    Optional argument:
     - if 'quiet' is True, it does not fail if a filter catches nothing
        (default False)

    Without argument, it defaults to:
        _check_py3k_warnings(("", DeprecationWarning), quiet=False)