code: def test_hnsw_estimator(pool_params, distance, dimension):
      data = np.fromfile(
          pool_params["pool_file"], dtype=pool_params["dtype"]
      )
      data = data.reshape((data.size // dimension, dimension))
      estimator = HnswEstimator(
          distance=distance,
          level_size_decay=2,
          max_neighbors=5,
          search_neighborhood_size=30,
          batch_size=10,
          upper_level_batch_size=10,
          num_exact_candidates=10,
      )
      estimator.fit(data)
      neighbor_distances, neighbor_ids = estimator.kneighbors(
          [data[0]], n_neighbors=20, search_neighborhood_size=40
      )
      neighbor_ids2 = estimator.kneighbors(
          [data[0]],
          n_neighbors=20,
          search_neighborhood_size=40,
          return_distance=False,
      )
      assert np.array_equal(neighbor_ids, neighbor_ids2)
  
      neighbor_distances_file = yatest.common.test_output_path(
          "neighbor_distances"
      )
      np.savetxt(neighbor_distances_file, neighbor_distances)
  
      neighbor_ids_file = yatest.common.test_output_path("neighbor_ids")
      np.savetxt(neighbor_ids_file, neighbor_ids, fmt="%i")
  
      return [
          yatest.common.canonical_file(
              neighbor_distances_file, local=True
          ),
          yatest.common.canonical_file(neighbor_ids_file, local=True),
      ]
  
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 13 for calling a global function with example usage: test_hnsw_estimator(pool_params, distance, dimension) and returns: list