code: def clear(self) -> None:
          
          if self._cache_directory is not None:
              # Safety - if there isn't a cache directory file, this probably isn't a valid cache
              assert os.path.exists(self._cache_directory_index), "Attempt to clear a non-existent cache"
              self._load()            # Shouldn't have any impact but...
              for e in self._cache.values():
                  if os.path.exists(e.loc):
                      os.remove(e.loc)
              self._cache.clear()
              self._update()
          self._cache = {}
docs: Clear all cache entries for directory and, if it is a 'pure' directory, remove the directory itself