human
Complete the below
def emits_warning(*messages):

    ''''Mark a test as emitting a warning.
    With no arguments, squelches all SAWarning failures.  Or pass one or more
    strings.
these will be matched to the root of the warning description by
    warnings.filterwarnings().'
    '''
 ... What is a the Python program you requested?
assistant
#Here is the Python program you requested.
    @decorator
    def decorate(fn, *args, **kw):
        filters = [dict(action='ignore', category=sa_exc.SAPendingDeprecationWarning)]
        if (not messages):
            filters.append(dict(action='ignore', category=sa_exc.SAWarning))
        else:
            filters.extend((dict(action='ignore', message=message, category=sa_exc.SAWarning) for message in messages))
        for f in filters:
            warnings.filterwarnings(**f)
        try:
            return fn(*args, **kw)
        finally:
            resetwarnings()
    return decorate