code: def split_indexes_into_chunks(nsplits, indexes, ret_is_asc=True):
      indexes = np.asarray(indexes)
      chunk_idxes = np.empty_like(indexes)
      cum_nsplits = [np.cumsum(nsplit) for nsplit in nsplits]
      for i, cum_nsplit, index in zip(
          itertools.count(0), cum_nsplits, indexes
      ):
          # handle negative value in index
          if hasattr(index, "flags") and not index.flags.writeable:
              index = index.copy()
          index = np.add(
              index, cum_nsplit[-1], out=index, where=index < 0
          )
          sorted_idx = np.argsort(index)
  
          if np.any(index >= cum_nsplit[-1]):
              idx = index[index >= cum_nsplit[-1]][0]
              raise IndexError(
                  f"index {idx} is out of bounds with size {cum_nsplit[-1]}"
              )
  
          chunk_idx = np.searchsorted(
              cum_nsplit, index[sorted_idx], side="right"
          )
          chunk_idxes[i, sorted_idx] = chunk_idx
  
      chunk_idxes_asc = False
      if ret_is_asc:
          chunk_idxes_asc = is_asc_sorted(np.lexsort(chunk_idxes[::-1]))
  
      chunk_index_to_indexes = OrderedDict()
      chunk_index_to_poses = OrderedDict()
      poses = np.arange(len(indexes[0]))
      for idx in itertools.product(
          *(range(len(nsplit)) for nsplit in nsplits)
      ):
          cond = (
              chunk_idxes == np.array(idx).reshape((len(idx), 1))
          ).all(axis=0)
          filtered = indexes[:, cond]
          for i in range(len(indexes)):
              filtered[i] = filtered[i] - (
                  cum_nsplits[i][idx[i] - 1] if idx[i] > 0 else 0
              )
          chunk_index_to_indexes[idx] = filtered
          chunk_index_to_poses[idx] = poses[cond]
  
      if ret_is_asc:
          return (
              chunk_index_to_indexes,
              chunk_index_to_poses,
              chunk_idxes_asc,
          )
      return chunk_index_to_indexes, chunk_index_to_poses
  
imports: import inspect
  import itertools
  import operator
  from collections import OrderedDict
  from collections.abc import Iterable
  from functools import lru_cache, reduce, wraps
  from math import ceil
  from numbers import Integral
  from typing import Dict, List, Union
  import numpy
  from ..core import ExecutableTuple, recursive_tile
  from ..utils import lazy_import
  from ..lib.mmh3 import hash_from_buffer
label_desc: Use image node_id 17 for calling a global function with example usage: split_indexes_into_chunks(nsplits, indexes, ret_is_asc) and returns: chunk_index_to_indexes,  chunk_index_to_poses, chunk_index_to_indexes,  chunk_index_to_poses,  chunk_idxes_asc