code: def test_from_rotvec_small_angle():
      rotvec = np.array(
          [
              [
                  5e-4 / np.sqrt(3),
                  -5e-4 / np.sqrt(3),
                  5e-4 / np.sqrt(3),
              ],
              [0.2, 0.3, 0.4],
              [0, 0, 0],
          ]
      )
  
      quat = Rotation.from_rotvec(rotvec).as_quat()
      # cos(theta/2) ~~ 1 for small theta
      assert_allclose(quat[0, 3], 1)
      # sin(theta/2) / theta ~~ 0.5 for small theta
      assert_allclose(quat[0, :3], rotvec[0] * 0.5)
  
      assert_allclose(quat[1, 3], 0.9639685)
      assert_allclose(
          quat[1, :3],
          np.array(
              [
                  0.09879603932153465,
                  0.14819405898230198,
                  0.19759207864306931,
              ]
          ),
      )
  
      assert_equal(quat[2], np.array([0, 0, 0, 1]))
  
imports: from __future__ import division, print_function, absolute_import
  import pytest
  import numpy
  from numpy.testing import assert_equal, assert_array_almost_equal
  from numpy.testing import assert_allclose
  from scipy.spatial.transform import Rotation, Slerp
  from scipy.stats import special_ortho_group
  from itertools import permutations
label_desc: Use image node_id 20 for calling a global function with example usage: test_from_rotvec_small_angle() without return types