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