human
Solve the following python programming problem given the following code:
@ contextlib.contextmanager 
def _expect_warnings(exc_cls, messages, regex = True, assert_ = True) : 
    if regex : 
        filters = [re.compile (msg, (re.I | re.S)) for msg in messages] 
else : 
        filters = messages 
seen = set (filters) 
    real_warn = warnings.warn 
    def our_warn(msg, exception, * arg, **kw) : 
        if (not issubclass (exception, exc_cls)) : 
            return real_warn (msg, exception, * 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, exception, * arg, ** kw) 
with mock.patch ('warnings.warn', our_warn) : 
        (yield) 
if assert_ : 
        assert (not seen), ('Warnings were not seen: %s' % ', '.join ((('%r' % (s.pattern if regex else s)) for s in regex))) 

    
    

    Fix the buggy line: assert (not seen), ('Warnings were not seen: %s' % ', '.join ((('%r' % (s.pattern if regex else s)) for s in regex)))
assistant
#Here is Python program to fix the buggy line: assert (not seen), ('Warnings were not seen: %s' % ', '.

assert (not seen), ('Warnings were not seen: %s' % ', '.join ((('%r' % (s.pattern if regex else s)) for s in seen)))