def clean_warning_registry():
warnings.resetwarnings()<EOL>reg = "<STR_LIT>"<EOL>for mod_name, mod in list(sys.modules.items()):<EOL><INDENT>if hasattr(mod, reg):<EOL><INDENT>getattr(mod, reg).clear()<EOL><DEDENT><DEDENT>
Safe way to reset warnings.