code: def test_delete_by_term_has_del():
      schema = fields.Schema(key=fields.KEYWORD)
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              w.add_document(key="alfa")
              w.add_document(key="bravo")
              w.add_document(key="charlie")
  
          with ix.writer() as w:
              w.add_document(key="delta")
              w.add_document(key="echo")
              w.add_document(key="foxtrot")
              w.merge = False
  
          with ix.reader() as r:
              assert not r.has_deletions()
  
          with ix.writer() as w:
              w.delete_by_term("key", "bravo")
              w.optimize = True
  
          with ix.reader() as r:
              assert not r.has_deletions()
  
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 18 for calling a global function with example usage: test_delete_by_term_has_del() without return types