code: def test_perpendicular_directions():
      num = 35
  
      vectors_v = np.zeros((4, 3))
  
      for v in range(4):
          theta = random.uniform(0, np.pi)
          phi = random.uniform(0, 2 * np.pi)
          vectors_v[v] = sphere2cart(1.0, theta, phi)
      vectors_v[3] = [1, 0, 0]
  
      for vector_v in vectors_v:
          pd = perpendicular_directions(vector_v, num=num, half=False)
  
          # see if length of pd is equal to the number of intended samples
          assert_equal(num, len(pd))
  
          # check if all directions are perpendicular to vector v
          for d in pd:
              cos_angle = np.dot(d, vector_v)
              assert_almost_equal(cos_angle, 0)
  
          # check if directions are sampled by multiples of 2*pi / num
          delta_a = 2.0 * np.pi / num
          for d in pd[1:]:
              angle = np.arccos(np.dot(pd[0], d))
              rest = angle % delta_a
              if (
                  rest > delta_a * 0.99
              ):  # To correct cases of negative error
                  rest = rest - delta_a
              assert_almost_equal(rest, 0)
  
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 14 for calling a global function with example usage: test_perpendicular_directions() without return types