code: def dump_cache(path=None, python2=False, suffix=None):
      
      typelogging_enabled_tmp = pytypes.typelogging_enabled
      pytypes.typelogging_enabled = False
      if suffix is None:
          suffix = 'pyi2' if python2 else 'pyi'
      if path is None:
          path = pytypes.default_typelogger_path
      modules = {}
      for key in _member_cache:
          node = _member_cache[key]
          mname = node.get_modulename()
          if not mname in modules:
              mnode = _module_node(mname)
              modules[mname] = mnode
          else:
              mnode = modules[mname]
          mnode.append(node)
      for module in modules:
          _dump_module(modules[module], path, python2, suffix)
      pytypes.typelogging_enabled = typelogging_enabled_tmp
docs: Writes cached observations by @typelogged into stubfiles.
      Files will be created in the directory provided as 'path'; overwrites
      existing files without notice.
      Uses 'pyi2' suffix if 'python2' flag is given else 'pyi'. Resulting
      files will be Python 2.7 compilant accordingly.