class_docstr: context manager which archives & clears warning registry for duration of
  context.
  
  :param pattern:
        optional regex pattern, causes manager to only reset modules whose
        names match this pattern. defaults to ``".*"``.
code: def __enter__(self):
      # archive and clear the __warningregistry__ key for all modules
      # that match the 'reset' pattern.
      pattern = self._pattern
      backup = self._backup = {}
      for name, mod in list(sys.modules.items()):
          if pattern.match(name):
              reg = getattr(mod, "__warningregistry__", None)
              if reg and isinstance(reg, dict):
                  backup[name] = reg.copy()
                  reg.clear()
      return self
  
imports: from __future__ import annotations
  import re
  import sys
  from typing import Match
label_desc: Use image node_id 2 for calling the reset_warning_registry obj's underlying member method code with example usage: obj.__enter__() and returns: self