code: def generate_csr(size):
      nrows = 1000
      nnz = int((size - (nrows + 1) * 4) / (4 + 8))
      indptr = (
          np.arange(nrows + 1, dtype=np.float32) / nrows * nnz
      ).astype(np.int32)
      indptr[-1] = nnz
      indices = np.arange(nnz, dtype=np.int32)
      data = np.random.default_rng().uniform(low=0, high=1.0, size=nnz)
      return scipy.sparse.csr_matrix(
          (data, indices, indptr), shape=(nrows, nnz)
      )
  
imports: from .common import set_mem_rlimit, run_monitored, get_mem_info
  from io import BytesIO, StringIO
  import os
  import tempfile
  import numpy
  from .common import Benchmark, safe_import
label_desc: Use image node_id 2 for calling a global function with example usage: generate_csr(size) and returns: scipy