code: def test_sfqr(m, n, chunks, error_type):
      mat = np.random.default_rng().random((m, n))
      data = da.from_array(mat, chunks=chunks, name="A")
      m_q = m
      n_q = min(m, n)
      m_r = n_q
      n_r = n
      m_qtq = n_q
  
      if error_type is None:
          q, r = da.linalg.sfqr(data)
          assert_eq((m_q, n_q), q.shape)  # shape check
          assert_eq((m_r, n_r), r.shape)  # shape check
          assert_eq(mat, da.dot(q, r))  # accuracy check
          assert_eq(
              np.eye(m_qtq, m_qtq), da.dot(q.T, q)
          )  # q must be orthonormal
          assert_eq(
              r, da.triu(r.rechunk(r.shape[0]))
          )  # r must be upper triangular
      else:
          with pytest.raises(error_type):
              q, r = da.linalg.sfqr(data)
  
file_path: dask/dask/array/tests/test_cupy_linalg.py
imports: from __future__ import annotations
  import numpy
  import pytest
  from packaging.version import parse
  import dask.array
  from dask.array.utils import assert_eq
label_desc: Use image node_id 3 for calling a global function with example usage: test_sfqr(m, n, chunks, error_type) without return types