code: def test_all_stored_fields():
      # all_stored_fields() should yield all stored fields, even for deleted
      # documents
  
      schema = fields.Schema(a=fields.ID(stored=True), b=fields.STORED)
      ix = RamStorage().create_index(schema)
      with ix.writer() as w:
          w.add_document(a=u("alfa"), b=u("bravo"))
          w.add_document(a=u("apple"), b=u("bear"))
          w.add_document(a=u("alpaca"), b=u("beagle"))
          w.add_document(a=u("aim"), b=u("box"))
  
      w = ix.writer()
      w.delete_by_term("a", "apple")
      w.delete_by_term("a", "aim")
      w.commit(merge=False)
  
      with ix.searcher() as s:
          assert s.doc_count_all() == 4
          assert s.doc_count() == 2
          sfs = list((sf["a"], sf["b"]) for sf in s.all_stored_fields())
          assert sfs == [("alfa", "bravo"), ("alpaca", "beagle")]
  
imports: from __future__ import with_statement
  import random, threading, time
  import pytest
  from whoosh import fields, formats, reading
  from whoosh.compat import b, u, xrange
  from whoosh.reading import SegmentReader
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 11 for calling a global function with example usage: test_all_stored_fields() without return types