def our_warn(msg, *arg, **kw):
    if isinstance(msg, exc_cls):
        exception = type(msg)
        msg = str(msg)
    elif arg:
        exception = arg[0]
    else:
        exception = None
    if ((not exception) or (not issubclass(exception, exc_cls))):
        return real_warn(msg, *arg, **kw)
    if (not filters):
        return
    for filter_ in filters:
        if ((regex and filter_.match(msg)) or ((not regex) and (filter_ == msg))):
            seen.discard(filter_)
            break
    else:
        real_warn(msg, *arg, **kw)
def our_warn(msg, *arg, **kw):
    if isinstance(msg, exc_cls):
        exception = type(msg)
        msg = str(msg)
    elif arg:
        exception = arg[0]
    else:
        exception = None
    if ((not exception) or (not issubclass(exception, exc_cls))):
        return real_warn(msg, *arg, **kw)
    if (not filters):
        return
    for filter_ in filters:
        if ((regex and filter_.match(msg)) or ((not regex) and (filter_ == msg))):
            seen.discard(filter_)
            break
    else:
        real_warn(msg, *arg, **kw)