code: def _run(self, maj, min=None, data=5):
      import scipy.sparse
  
      for i in range(2):
          shape = self.n_rows, self.n_cols
          a = testing.shaped_sparse_random(
              shape, sparse, self.dtype, self.density, self.format
          )
          expected = testing.shaped_sparse_random(
              shape, scipy.sparse, self.dtype, self.density, self.format
          )
  
          maj_h = maj.get() if isinstance(maj, cupy.ndarray) else maj
          min_h = min.get() if isinstance(min, cupy.ndarray) else min
  
          data_is_cupy = isinstance(
              data, (cupy.ndarray, sparse.spmatrix)
          )
          data_h = data.get() if data_is_cupy else data
  
          if min is not None:
              actual = a
              actual[maj, min] = data
  
              expected[maj_h, min_h] = data_h
          else:
              actual = a
              actual[maj] = data
  
              expected[maj_h] = data_h
  
      if cupyx.scipy.sparse.isspmatrix(actual):
          actual.sort_indices()
          expected.sort_indices()
  
          cupy.testing.assert_array_equal(
              actual.indptr, expected.indptr
          )
          cupy.testing.assert_array_equal(
              actual.indices, expected.indices
          )
          cupy.testing.assert_array_equal(actual.data, expected.data)
  
      else:
          cupy.testing.assert_array_equal(
              actual.ravel(), cupy.array(expected).ravel()
          )
  
imports: import functools
  import itertools
  import numpy
  import pytest
  import cupy
  import cupyx
  from cupy import testing
  from cupy.cuda import runtime
  from cupyx.scipy import sparse
label_desc: Use image node_id 1 for calling the TestSetitemIndexing obj's underlying member method code with example usage: obj._run(maj, min, data) without return types