code: def cleanup_index(request, es, index_name):
      def fin():
          try:
              es.indices.delete(index_name)
          except NotFoundError:
              pass
  
      request.addfinalizer(fin)
  
file_path: image-match/tests/test_elasticsearch_driver_metadata_as_nested.py
imports: import pytest
  import os
  import hashlib
  from elasticsearch import Elasticsearch, ConnectionError, RequestError, NotFoundError
  from time import sleep
  from image_match.elasticsearch_driver import SignatureES
  from PIL import Image
label_desc: Use image node_id 3 for calling a global function with example usage: cleanup_index(request, es, index_name) without return types