code: def test_degenerate_cases(rng):
      sphere = default_sphere
  
      # completely isotropic and degenerate case
      odf = np.zeros(sphere.vertices.shape[0])
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
      print(directions, values, indices)
  
      assert_equal(len(values), 0)
      assert_equal(len(directions), 0)
      assert_equal(len(indices), 0)
  
      odf = np.zeros(sphere.vertices.shape[0])
      odf[0] = 0.020
      odf[1] = 0.018
  
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
      print(directions, values, indices)
  
      assert_equal(values[0], 0.02)
  
      odf = -np.ones(sphere.vertices.shape[0])
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
      print(directions, values, indices)
  
      assert_equal(len(values), 0)
  
      odf = np.zeros(sphere.vertices.shape[0])
      odf[0] = 0.020
      odf[1] = 0.018
      odf[2] = -0.018
  
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
      assert_equal(values[0], 0.02)
  
      odf = np.ones(sphere.vertices.shape[0])
      odf += 0.1 * rng.random(odf.shape[0])
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
      assert_(all(values > values[0] * 0.5))
      assert_array_equal(values, odf[indices])
  
      odf = np.ones(sphere.vertices.shape[0])
      odf[1:] = np.finfo(float).eps * rng.random(odf.shape[0] - 1)
      directions, values, indices = peak_directions(
          odf, sphere, 0.5, 25
      )
  
      assert_equal(values[0], 1)
      assert_equal(len(values), 1)
  
imports: import warnings
  import numpy
  import pickle
  from io import BytesIO
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_almost_equal, assert_equal, assert_
  from dipy.reconst.odf import OdfFit, OdfModel, gfa
  from dipy.direction.peaks import peaks_from_model, peak_directions, peak_directions_nl, reshape_peaks_for_visualization
  from dipy.core.subdivide_octahedron import create_unit_hemisphere
  from dipy.core.sphere import unit_icosahedron
  from dipy.sims.voxel import multi_tensor, multi_tensor_odf
  from dipy.data import get_fnames, get_sphere, default_sphere
  from dipy.core.gradients import gradient_table, GradientTable
  from dipy.core.sphere_stats import angular_similarity
  from dipy.core.sphere import HemiSphere
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.reconst.shm import descoteaux07_legacy_msg, tournier07_legacy_msg
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 7 for calling a global function with example usage: test_degenerate_cases(rng) without return types