code: def trace_memory_clean_caches(self):
          
  
          urllib.parse.clear_cache()
          re.purge()
          linecache.clearcache()
          copyreg.clear_extension_cache()
  
          if hasattr(fnmatch, "purge"):
              fnmatch.purge()  # pylint: disable=no-member
          elif hasattr(fnmatch, "_purge"):
              fnmatch._purge()  # pylint: disable=no-member
  
          if hasattr(encodings, "_cache") and len(encodings._cache) > 0:
              encodings._cache = {}
  
          for handler in context.log.handlers:
              handler.flush()
docs: Avoid polluting results with some builtin python caches