code: def test_index_contains_remove_rename(batch_size):
      if batch_size <= 1:
          return
  
      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)
      assert np.all(index.contains(keys))
      assert np.all(index.count(keys) == np.ones(batch_size))
  
      removed_keys = keys[: batch_size // 2]
      remaining_keys = keys[batch_size // 2 :]
      index.remove(removed_keys)
      assert len(index) == (len(keys) - len(removed_keys))
      assert np.sum(index.contains(keys)) == len(remaining_keys)
      assert np.sum(index.count(keys)) == len(remaining_keys)
      assert np.sum(index.count(removed_keys)) == 0
  
      assert keys[0] not in index
      assert keys[-1] in index
  
      renamed_counts = index.rename(removed_keys, removed_keys)
      assert np.sum(index.count(renamed_counts)) == 0
  
      renamed_counts = index.rename(remaining_keys, removed_keys)
      assert np.sum(index.count(removed_keys)) == len(index)
  
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 7 for calling a global function with example usage: test_index_contains_remove_rename(batch_size) without return types