code: def test_DeterministicMaximumDirectionGetter():
      # Test the DeterministicMaximumDirectionGetter
  
      direction = unit_octahedron.vertices[-1].copy()
      point = np.zeros(3)
      N = unit_octahedron.theta.shape[0]
  
      # No valid direction
      pmf = np.zeros((3, 3, 3, N))
      dg = DeterministicMaximumDirectionGetter.from_pmf(
          pmf, 90, unit_octahedron
      )
      state = dg.get_direction(point, direction)
      npt.assert_equal(state, 1)
  
      # Test BF #1566 - bad condition in DeterministicMaximumDirectionGetter
      pmf = np.zeros((3, 3, 3, N))
      pmf[0, 0, 0, 0] = 1
      dg = DeterministicMaximumDirectionGetter.from_pmf(
          pmf, 0, unit_octahedron
      )
      state = dg.get_direction(point, direction)
      npt.assert_equal(state, 1)
  
file_path: dipy/dipy/direction/tests/test_prob_direction_getter.py
imports: import warnings
  import numpy
  import numpy.testing
  from dipy.core.sphere import unit_octahedron
  from dipy.reconst.shm import descoteaux07_legacy_msg, tournier07_legacy_msg, SphHarmFit, SphHarmModel
  from dipy.direction import DeterministicMaximumDirectionGetter, ProbabilisticDirectionGetter
label_desc: Use image node_id 2 for calling a global function with example usage: test_DeterministicMaximumDirectionGetter() without return types