code: def test_rotg(dtype):
      rotg = _rotg_memview[_numpy_to_cython(dtype)]
  
      rng = np.random.RandomState(0)
      a = dtype(rng.randn())
      b = dtype(rng.randn())
      c, s = 0.0, 0.0
  
      def expected_rotg(a, b):
          roe = a if abs(a) > abs(b) else b
          if a == 0 and b == 0:
              c, s, r, z = (1, 0, 0, 0)
          else:
              r = np.sqrt(a**2 + b**2) * (1 if roe >= 0 else -1)
              c, s = a / r, b / r
              z = s if roe == a else (1 if c == 0 else 1 / c)
          return r, z, c, s
  
      expected = expected_rotg(a, b)
      actual = rotg(a, b, c, s)
  
      assert_allclose(actual, expected, rtol=RTOL[dtype])
  
file_path: scikit-learn/sklearn/utils/tests/test_cython_blas.py
imports: import numpy
  import pytest
  from sklearn.utils._cython_blas import ColMajor, NoTrans, RowMajor, Trans, _asum_memview, _axpy_memview, _copy_memview, _dot_memview, _gemm_memview, _gemv_memview, _ger_memview, _nrm2_memview, _rot_memview, _rotg_memview, _scal_memview
  from sklearn.utils._testing import assert_allclose
label_desc: Use image node_id 9 for calling a global function with example usage: test_rotg(dtype) and returns: r,  z,  c,  s