code: def _chunk(arr) -> Dict[str, Any]:
      """Convert array to a canonical dictionary of chunked arrays."""
      chunksize = max(1, int(MAX_CHUNK_SIZE / arr.dtype.itemsize))
      data = {
          "__msgpack_chunked_array__": True,
          "shape": _tuple_to_dict(arr.shape),
      }
      flatarr = arr.reshape(-1)
      chunks = [
          flatarr[i : i + chunksize]
          for i in range(0, flatarr.size, chunksize)
      ]
      data["chunks"] = _tuple_to_dict(chunks)
      return data
  
imports: import enum
  import threading
  from contextlib import contextmanager
  from typing import Any, Dict, List
  import jax
  import msgpack
  import numpy
label_desc: Use image node_id 19 for calling a global function with example usage: _chunk(arr) and returns: data