code: def test_is_hemispherical():
      # Smoke test the ValueError for non-3D vectors
      assert_raises(
          ValueError,
          is_hemispherical,
          np.array([[1, 2, 3, 4], [5, 6, 7, 8]]),
      )
  
      # Test on hemispherical input
      xyz = random_uniform_on_sphere(n=100, coords="xyz")
      xyz = xyz[xyz[:, 2] > 0]
      assert_equal(is_hemispherical(xyz)[0], True)
  
      # Test on spherical input
      xyz = random_uniform_on_sphere(n=100, coords="xyz")
      assert_equal(is_hemispherical(xyz)[0], False)
  
      # Smoke test the ValueError for non unit-vectors
      assert_raises(ValueError, is_hemispherical, xyz * 2.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 17 for calling a global function with example usage: test_is_hemispherical() without return types