code: def test_remove_similar_peaks():
      vertices = np.array(
          [
              [1.0, 0.0, 0.0],
              [0.0, 1.0, 0.0],
              [0.0, 0.0, 1.0],
              [1.1, 1.0, 0.0],
              [0.0, 2.0, 1.0],
              [2.0, 1.0, 0.0],
              [1.0, 0.0, 0.0],
          ]
      )
      norms = np.sqrt((vertices * vertices).sum(-1))
      vertices = vertices / norms[:, None]
  
      # Return unique vertices
      uv = remove_similar_vertices(vertices, 0.01)
      npt.assert_array_equal(uv, vertices[:6])
  
      # Return vertices with mapping and indices
      uv, mapping, index = remove_similar_vertices(
          vertices, 0.01, return_mapping=True, return_index=True
      )
      npt.assert_array_equal(uv, vertices[:6])
      npt.assert_array_equal(mapping, list(range(6)) + [0])
      npt.assert_array_equal(index, range(6))
  
      # Test mapping with different angles
      uv, mapping = remove_similar_vertices(
          vertices, 0.01, return_mapping=True
      )
      npt.assert_array_equal(uv, vertices[:6])
      npt.assert_array_equal(mapping, list(range(6)) + [0])
      uv, mapping = remove_similar_vertices(
          vertices, 30, return_mapping=True
      )
      npt.assert_array_equal(uv, vertices[:4])
      npt.assert_array_equal(mapping, list(range(4)) + [1, 0, 0])
      uv, mapping = remove_similar_vertices(
          vertices, 60, return_mapping=True
      )
      npt.assert_array_equal(uv, vertices[:3])
      npt.assert_array_equal(mapping, list(range(3)) + [0, 1, 0, 0])
  
      # Test index with different angles
      uv, index = remove_similar_vertices(
          vertices, 0.01, return_index=True
      )
      npt.assert_array_equal(uv, vertices[:6])
      npt.assert_array_equal(index, range(6))
      uv, index = remove_similar_vertices(
          vertices, 30, return_index=True
      )
      npt.assert_array_equal(uv, vertices[:4])
      npt.assert_array_equal(index, range(4))
      uv, index = remove_similar_vertices(
          vertices, 60, return_index=True
      )
      npt.assert_array_equal(uv, vertices[:3])
      npt.assert_array_equal(index, range(3))
  
file_path: dipy/dipy/reconst/tests/test_peak_finding.py
imports: import numpy
  import numpy.testing
  from dipy.reconst.recspeed import local_maxima, remove_similar_vertices, search_descending
  from dipy.data import default_sphere
  from dipy.core.sphere import unique_edges, HemiSphere
label_desc: Use image node_id 2 for calling a global function with example usage: test_remove_similar_peaks() without return types