def runWithWarningsSuppressed(suppressedWarnings, f, *a, **kw):
    for args, kwargs in suppressedWarnings:
        warnings.filterwarnings(*args, **kwargs)
    addedFilters = warnings.filters[:len(suppressedWarnings)]
    try:
        result = f(*a, **kw)
    except:
        exc_info = sys.exc_info()
        _resetWarningFilters(None, addedFilters)
        raise exc_info[0], exc_info[1], exc_info[2]
    else:
        if isinstance(result, defer.Deferred):
            result.addBoth(_resetWarningFilters, addedFilters)
        else:
            _resetWarningFilters(None, addedFilters)
        return result
Run the function C{f}, but with some warnings suppressed.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/utils.py/runWithWarningsSuppressed