code: def test_online_hnsw_index(pool_params, distance):
      pool = Pool.from_file(
          pool_params["pool_file"], pool_params["component_type"], 10
      )
      online_hnsw = OnlineHnsw(
          pool_params["component_type"],
          10,
          distance,
          level_size_decay=2,
          max_neighbors=5,
          search_neighborhood_size=50,
      )
      for i in range(pool.get_num_items()):
          online_hnsw.add_item(pool.get_item(i))
      online_hnsw_1_neighbors = online_hnsw.get_nearest(
          online_hnsw.get_item(0), 20
      )
      online_hnsw_2_neighbors = online_hnsw.get_nearest_and_add_item(
          online_hnsw.get_item(0)
      )
      assert online_hnsw.get_num_items() == pool.get_num_items() + 1
      assert len(online_hnsw_2_neighbors) == 50
      online_hnsw_2_neighbors = online_hnsw_2_neighbors[:20]
      assert online_hnsw_1_neighbors == online_hnsw_2_neighbors
  
imports: from __future__ import print_function
  import pytest
  import os
  import numpy
  import yatest.common
  import struct
  from hnsw import EVectorComponentType, EDistance, Pool, Hnsw, HnswException, transform_mobius, HnswEstimator, OnlineHnsw
label_desc: Use image node_id 15 for calling a global function with example usage: test_online_hnsw_index(pool_params, distance) without return types