code: def test_rp_trees_should_not_stack_overflow_with_near_duplicate_data(
      seed, cosine_near_duplicates_data
  ):
      n_neighbors = 10
      knn_indices, _ = NNDescent(
          cosine_near_duplicates_data,
          "cosine",
          {},
          n_neighbors,
          random_state=np.random.RandomState(seed),
          n_trees=20,
      )._neighbor_graph
  
      for i in range(cosine_near_duplicates_data.shape[0]):
          assert len(knn_indices[i]) == len(
              np.unique(knn_indices[i])
          ), "Duplicate graph_indices in knn graph"
  
imports: import os
  import io
  import re
  import pytest
  from contextlib import redirect_stdout
  import numpy
  from sklearn.neighbors import KDTree
  from sklearn.neighbors import NearestNeighbors
  from sklearn.preprocessing import normalize
  import pickle
  import joblib
  import scipy
  from pynndescent import NNDescent, PyNNDescentTransformer
label_desc: Use image node_id 14 for calling a global function with example usage: test_rp_trees_should_not_stack_overflow_with_near_duplicate_data(seed, cosine_near_duplicates_data) without return types