def ignore_warnings(obj=None):
if callable(obj):<EOL><INDENT>return _ignore_warnings(obj)<EOL><DEDENT>else:<EOL><INDENT>return _IgnoreWarnings()<EOL><DEDENT>
Context manager and decorator to ignore warnings
    Note. Using this (in both variants) will clear all warnings
    from all python modules loaded. In case you need to test
    cross-module-warning-logging this is not your tool of choice.
    Examples
    --------
    >>> with ignore_warnings():
    ...     warnings.warn('buhuhuhu')
    >>> def nasty_warn():
    ...    warnings.warn('buhuhuhu')
    ...    print(42)
    >>> ignore_warnings(nasty_warn)()
    42