code: def is_valid_rotation(M):
      if not np.allclose(np.linalg.det(M), 1):
          return False
      return np.allclose(np.eye(3), np.dot(M, M.T))
  
file_path: nibabel/nibabel/tests/test_euler.py
imports: import math
  import numpy
  import pytest
  from numpy import pi
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..None import eulerangles
  from ..None import quaternions
label_desc: Use image node_id 5 for calling a global function with example usage: is_valid_rotation(M) and returns: np, False