code: def _sim_blocks(trmat, blocks, ptrs, min_sim, max_nbrs):
      "Compute the similarity matrix with blocked CSR kernel calls"
      nitems = trmat.nrows
      nblocks = len(blocks)
  
      null = create_empty(1, 1)
      res = [null for i in range(nblocks)]
  
      rmat_h = csrk.to_handle(trmat)
      csrk.order_columns(rmat_h)
  
      for bi in prange(nblocks):
          b = blocks[bi]
          p = ptrs[bi]
          bs, be = p
          bres = _sim_block(
              b, bs, be, rmat_h, min_sim, max_nbrs, nitems
          )
          res[bi] = bres
  
      csrk.release_handle(rmat_h)
  
      return res
  
imports: from sys import intern
  import logging
  import warnings
  import pandas
  import numpy
  import scipy.sparse
  import scipy.sparse.linalg
  from csr import CSR, create_from_sizes, create_empty
  import csr.kernel
  from numba import njit, prange
  from numba.typed import List
  from lenskit import util, DataWarning, ConfigWarning
  from lenskit.data import sparse_ratings
  from lenskit.sharing import in_share_context
  from lenskit.util.parallel import is_mp_worker
  from lenskit.util.accum import kvp_minheap_insert, kvp_minheap_sort
  from .None import Predictor
label_desc: Use image node_id 5 for calling a global function with example usage: _sim_blocks(trmat, blocks, ptrs, min_sim, max_nbrs) and returns: res