code: def test_buffered_update():
      schema = fields.Schema(
          id=fields.ID(stored=True, unique=True), payload=fields.STORED
      )
      with TempIndex(schema, "bufferedupdate") as ix:
          w = writing.BufferedWriter(ix, period=None, limit=5)
          for i in xrange(10):
              for char in "abc":
                  fs = dict(id=char, payload=text_type(i) + char)
                  w.update_document(**fs)
  
          with w.reader() as r:
              sfs = [sf for _, sf in r.iter_docs()]
              sfs = sorted(sfs, key=lambda x: x["id"])
              assert sfs == [
                  {"id": u("a"), "payload": u("9a")},
                  {"id": u("b"), "payload": u("9b")},
                  {"id": u("c"), "payload": u("9c")},
              ]
              assert r.doc_count() == 3
  
          w.close()
  
imports: from __future__ import with_statement
  import random, time, threading
  import pytest
  from whoosh import analysis, fields, query, writing
  from whoosh.compat import b, u, xrange, text_type
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 7 for calling a global function with example usage: test_buffered_update() without return types