code: def test_reindex():
      sample_docs = [
          {
              "id": u("test1"),
              "text": u("This is a document. Awesome, is it not?"),
          },
          {
              "id": u("test2"),
              "text": u("Another document. Astounding!"),
          },
          {
              "id": u("test3"),
              "text": u(
                  "A fascinating article on the behavior of domestic "
                  "steak knives."
              ),
          },
      ]
  
      schema = fields.Schema(
          text=fields.TEXT(stored=True),
          id=fields.ID(unique=True, stored=True),
      )
      with TempIndex(schema, "reindex") as ix:
  
          def reindex():
              writer = ix.writer()
              for doc in sample_docs:
                  writer.update_document(**doc)
              writer.commit()
  
          reindex()
          assert ix.doc_count() == 3
          reindex()
          assert ix.doc_count() == 3
  
imports: from __future__ import with_statement
  import random
  from collections import defaultdict
  from datetime import datetime
  import pytest
  from whoosh import analysis, fields, index, qparser, query, __version__
  from whoosh.compat import b, u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.writing import IndexingError
  from whoosh.util.numeric import length_to_byte, byte_to_length
  from whoosh.util.testing import TempIndex, TempStorage
label_desc: Use image node_id 17 for calling a global function with example usage: test_reindex() without return types