code: def _csr_indptr_to_coo_rows(nnz, Bp):
      from cupy_backends.cuda.libs import cusparse
  
      out_rows = cupy.empty(nnz, dtype=numpy.int32)
  
      # Build a COO row array from output CSR indptr.
      # Calling backend cusparse API directly to avoid
      # constructing a whole COO object.
      handle = device.get_cusparse_handle()
      if runtime.is_hip and nnz == 0:
          raise ValueError(
              "hipSPARSE currently cannot handle "
              "sparse matrices with null ptrs"
          )
      cusparse.xcsr2coo(
          handle,
          Bp.data.ptr,
          nnz,
          Bp.size - 1,
          out_rows.data.ptr,
          cusparse.CUSPARSE_INDEX_BASE_ZERO,
      )
  
      return out_rows
  
imports: import cupy
  from cupy import _core
  from cupyx.scipy.sparse._base import isspmatrix
  from cupyx.scipy.sparse._base import spmatrix
  from cupy.cuda import device
  from cupy.cuda import runtime
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _csr_indptr_to_coo_rows(nnz, Bp) and returns: out_rows