code: def test_missing_len():
      """
      We should get a helpful error message if our vector doesn't have a
      __len__ method.
      """
  
      class FakeCollection:
          pass
  
      i = AnnoyIndex(10, "euclidean")
      with pytest.raises(TypeError) as excinfo:
          i.add_item(1, FakeCollection())
      assert (
          str(excinfo.value)
          == "object of type 'FakeCollection' has no len()"
      )
  
file_path: annoy/test/types_test.py
imports: import random
  import numpy
  import pytest
  from annoy import AnnoyIndex
label_desc: Use image node_id 5 for calling a global function with example usage: test_missing_len() without return types