code: def test_vector_load(fast=True, fast_batch=True, seq=True):
      space_type = "cosinesimil"
      space_param = []
      method_name = "small_world_rand"
      index_name = method_name + ".index"
      if os.path.isfile(index_name):
          os.remove(index_name)
      f = "/tmp/foo.txt"
      if not os.path.isfile(f):
          print("creating %s" % f)
          np.savetxt(f, np.random.rand(100000, 1000), delimiter="\t")
          print("done")
  
      if fast:
          index = nmslib.init(
              space_type,
              space_param,
              method_name,
              nmslib.DataType.DENSE_VECTOR,
              nmslib.DistType.FLOAT,
          )
          with TimeIt("fast add data point"):
              data = read_data_fast(f)
              nmslib.addDataPointBatch(
                  index, np.arange(len(data), dtype=np.int32), data
              )
          nmslib.freeIndex(index)
  
      if fast_batch:
          index = nmslib.init(
              space_type,
              space_param,
              method_name,
              nmslib.DataType.DENSE_VECTOR,
              nmslib.DistType.FLOAT,
          )
          with TimeIt("fast_batch add data point"):
              offset = 0
              for data in read_data_fast_batch(f, 10000):
                  nmslib.addDataPointBatch(
                      index,
                      np.arange(len(data), dtype=np.int32) + offset,
                      data,
                  )
                  offset += data.shape[0]
          print("offset", offset)
          nmslib.freeIndex(index)
  
      if seq:
          index = nmslib.init(
              space_type,
              space_param,
              method_name,
              nmslib.DataType.DENSE_VECTOR,
              nmslib.DistType.FLOAT,
          )
          with TimeIt("seq add data point"):
              for id, data in enumerate(read_data(f)):
                  nmslib.addDataPoint(index, id, 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 6 for calling a global function with example usage: test_vector_load(fast, fast_batch, seq) without return types