code: def test_vector_loaded():
      space_type = "cosinesimil"
      space_param = []
      method_name = "small_world_rand"
      index_name = method_name + ".index"
      index = nmslib.init(
          space_type,
          space_param,
          method_name,
          nmslib.DataType.DENSE_VECTOR,
          nmslib.DistType.FLOAT,
      )
  
      for id, data in enumerate(read_data("sample_dataset.txt")):
          pos = nmslib.addDataPoint(index, id, data)
          if id != pos:
              print("id %s != pos %s" % (id, pos))
              sys.exit(1)
  
      print("Let's print a few data entries")
      print(
          "We have added %d data points" % nmslib.getDataPointQty(index)
      )
  
      for i in range(
          0, min(MAX_PRINT_QTY, nmslib.getDataPointQty(index))
      ):
          print(nmslib.getDataPoint(index, i))
  
      print("Let's invoke the index-build process")
  
      query_time_param = ["efSearch=50"]
  
      nmslib.loadIndex(index, index_name)
  
      print("The index %s is loaded" % index_name)
  
      nmslib.setQueryTimeParams(index, query_time_param)
  
      print("Query time parameters are set")
  
      print("Results for the loaded index")
  
      k = 2
      for idx, data in enumerate(read_data("sample_queryset.txt")):
          print(idx, nmslib.knnQuery(index, k, data))
  
      nmslib.freeIndex(index)
  
file_path: nmslib/python_bindings/integration_tests/test_nmslib.py
imports: import sys
  import os
  import time
  import numpy
  import nmslib
  from common import *
label_desc: Use image node_id 8 for calling a global function with example usage: test_vector_loaded() without return types