code: def test_get_cosine_similarity():
      X = np.random.rand(333, 10)
      expected = cosine_similarity(X)
  
      # threshold not triggered
      result = get_cosine_similarity(X)
      np.testing.assert_array_almost_equal(result, expected)
  
      # threshold triggered
      result = get_cosine_similarity(X, threshold=20)
      np.testing.assert_array_almost_equal(
          result, expected.astype("float16")
      )
  
      # multiple chunks
      result = get_cosine_similarity(X, threshold=20, chunk_size=10)
      np.testing.assert_array_almost_equal(
          result, expected.astype("float16")
      )
  
      # multiple chunks with parallelization enabled
      result = get_cosine_similarity(
          X, threshold=20, chunk_size=10, num_workers=4
      )
      np.testing.assert_array_almost_equal(
          result, expected.astype("float16")
      )
  
file_path: imagededup/tests/test_retrieval.py
imports: import sys
  import pytest
  import numpy
  from sklearn.metrics.pairwise import cosine_similarity
  from imagededup.handlers.search.retrieval import HashEval, cosine_similarity_chunk, get_cosine_similarity
  from imagededup.methods.hashing import Hashing
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_cosine_similarity() without return types