code: def test_triu(self, dtype):
      np_a, cp_a = self._make_matrix(dtype)
      m, n = self.shape
      for k in range(-m + 1, n):
          np_out = scipy.sparse.triu(np_a, k=k, format=self.out_format)
          cp_out = sparse.triu(cp_a, k=k, format=self.out_format)
          assert np_out.format == cp_out.format
          assert np_out.nnz == cp_out.nnz
          cupy.testing.assert_allclose(
              np_out.todense(), cp_out.todense()
          )
  
file_path: cupy/tests/cupyx_tests/scipy_tests/sparse_tests/test_extract.py
imports: import unittest
  import numpy
  import cupy
  from cupy import testing
  from cupyx.scipy import sparse
label_desc: Use image node_id 3 for calling the TestExtract obj's underlying member method code with example usage: obj.test_triu(dtype) without return types