code: def test_basic_conversion():
      f = 100
      i = AnnoyIndex(f, "hamming")
      u = numpy.random.binomial(1, 0.5, f)
      v = numpy.random.binomial(1, 0.5, f)
      i.add_item(0, u)
      i.add_item(1, v)
      u2 = i.get_item_vector(0)
      v2 = i.get_item_vector(1)
      assert numpy.dot(u - u2, u - u2) == pytest.approx(0.0)
      assert numpy.dot(v - v2, v - v2) == pytest.approx(0.0)
      assert i.get_distance(0, 0) == pytest.approx(0.0)
      assert i.get_distance(1, 1) == pytest.approx(0.0)
      assert i.get_distance(0, 1) == pytest.approx(
          numpy.dot(u - v, u - v)
      )
      assert i.get_distance(1, 0) == pytest.approx(
          numpy.dot(u - v, u - v)
      )
  
file_path: annoy/test/hamming_index_test.py
imports: import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic_conversion() without return types