code: def test_index_duplicates(batch_size):
      ndim = 8
      index = Index(ndim=ndim, multi=False)
      keys = np.arange(batch_size)
      vectors = random_vectors(count=batch_size, ndim=ndim)
      index.add(keys, vectors, threads=threads)
      with pytest.raises(Exception):
          index.add(keys, vectors, threads=threads)
  
      index = Index(ndim=ndim, multi=True)
      keys = np.arange(batch_size)
      vectors = random_vectors(count=batch_size, ndim=ndim)
      index.add(keys, vectors, threads=threads)
      index.add(keys, vectors, threads=threads)
      assert len(index) == batch_size * 2
  
      two_per_key = index.get(keys)
      assert np.vstack(two_per_key).shape == (2 * batch_size, ndim)
  
file_path: usearch/python/scripts/test_index.py
imports: import os
  import pytest
  import numpy
  from usearch.io import load_matrix, save_matrix
  from usearch.eval import random_vectors
  from usearch.index import search
  from usearch.index import Index, MetricKind, ScalarKind, Match, Matches, BatchMatches, Clustering
  from usearch.index import DEFAULT_CONNECTIVITY
label_desc: Use image node_id 4 for calling a global function with example usage: test_index_duplicates(batch_size) without return types