code: def write_buffers(writer: StreamWriter, buffers: List):
      def _write_cuda_buffer(
          cuda_buffer: Union["cupy.ndarray", "rmm.DeviceBuffer"]
      ):
          # convert cuda buffer to cupy ndarray
          cuda_buffer = _convert_to_cupy_ndarray(cuda_buffer)
  
          chunk_size = CUDA_CHUNK_SIZE
          offset = 0
          nbytes = buffer.nbytes
          while offset < nbytes:
              size = (
                  chunk_size
                  if (offset + chunk_size) < nbytes
                  else nbytes - offset
              )
              # slice on cupy ndarray
              chunk_buffer = cuda_buffer[offset : offset + size]
              # `get` will return numpy ndarray,
              # write its data which is a memoryview into writer
              writer.write(chunk_buffer.get().data)
              offset += size
  
      for buffer in buffers:
          if hasattr(buffer, "__cuda_array_interface__"):
              # GPU buffer
              _write_cuda_buffer(buffer)
          else:
              writer.write(buffer)
  
imports: from asyncio import StreamReader, StreamWriter
  from typing import Dict, List, Union
  import numpy
  from ....serialization.aio import BUFFER_SIZES_NAME
  from ....utils import lazy_import
label_desc: Use image node_id 2 for calling a global function with example usage: write_buffers(writer, buffers) without return types