code: def box_matrix(typ, val, c):
      struct_ptr = cgutils.create_struct_proxy(typ)(
          c.context, c.builder, value=val
      )
  
      data_obj = c.box(typ.data, struct_ptr.data)
      indices_obj = c.box(typ.indices, struct_ptr.indices)
      indptr_obj = c.box(typ.indptr, struct_ptr.indptr)
      shape_obj = c.box(typ.shape, struct_ptr.shape)
  
      c.pyapi.incref(data_obj)
      c.pyapi.incref(indices_obj)
      c.pyapi.incref(indptr_obj)
      c.pyapi.incref(shape_obj)
  
      cls_obj = c.pyapi.unserialize(
          c.pyapi.serialize_object(typ.instance_class)
      )
      obj = c.pyapi.call_function_objargs(
          cls_obj, (data_obj, indices_obj, indptr_obj, shape_obj)
      )
  
      c.pyapi.decref(data_obj)
      c.pyapi.decref(indices_obj)
      c.pyapi.decref(indptr_obj)
      c.pyapi.decref(shape_obj)
  
      return obj
  
imports: import numpy
  import scipy
  import scipy.sparse
  from numba.core import cgutils, types
  from numba.core.imputils import impl_ret_borrowed
  from numba.extending import NativeValue, box, intrinsic, make_attribute_wrapper, models, overload, overload_attribute, overload_method, register_model, typeof_impl, unbox
label_desc: Use image node_id 4 for calling a global function with example usage: box_matrix(typ, val, c) and returns: obj