code: def test_vector_cosine(rng):
      a = [0, 1]
      b = [1, 0]
      assert_array_almost_equal(vector_cosine(a, b), 0)
      assert_array_almost_equal(vector_cosine([1, 0], [-1, 0]), -1)
      assert_array_almost_equal(
          vector_cosine([1, 0], [1, 1]), 1 / np.sqrt(2)
      )
      assert_array_almost_equal(vector_cosine([2, 0], [-4, 0]), -1)
      pts1 = [2, 1, 0]
      pts2 = [-2, -1, 0]
      assert_array_almost_equal(vector_cosine(pts1, pts2), -1)
      pts2 = [[-2, -1, 0], [2, 1, 0]]
      assert_array_almost_equal(vector_cosine(pts1, pts2), [-1, 1])
      # test relationship with correlation
      # not the same if non-zero vector mean
      a = rng.uniform(size=(100,))
      b = rng.uniform(size=(100,))
      cc = np.corrcoef(a, b)[0, 1]
      vcos = vector_cosine(a, b)
      assert not np.allclose(cc, vcos)
      # is the same if zero vector mean
      a_dm = a - np.mean(a)
      b_dm = b - np.mean(b)
      vcos = vector_cosine(a_dm, b_dm)
      assert_array_almost_equal(cc, vcos)
  
imports: import numpy
  import random
  from dipy.core.geometry import sphere2cart, cart2sphere, nearest_pos_semi_def, sphere_distance, cart_distance, vector_cosine, lambert_equal_area_projection_polar, circumradius, vec2vec_rotmat, vector_norm, compose_transformations, compose_matrix, decompose_matrix, perpendicular_directions, dist_to_corner, is_hemispherical
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_equal, assert_raises, assert_almost_equal
  from dipy.testing.spherepoints import sphere_points
  from dipy.testing.decorators import set_random_number_generator
  from dipy.core.sphere_stats import random_uniform_on_sphere
  from itertools import permutations
label_desc: Use image node_id 7 for calling a global function with example usage: test_vector_cosine(rng) without return types