code: def _index_for_subindex(
      a_idx: tuple[slice, ...],
      sub_idx: tuple[slice, ...],
      shape: tuple[int, ...],
  ) -> tuple[slice, ...]:
      assert len(a_idx) == len(sub_idx)
  
      return tuple(
          _index_for_subslice(a, sub, length)
          for a, sub, length in zip(a_idx, sub_idx, shape)
      )
  
file_path: cupy/cupyx/distributed/array/_index_arith.py
imports: import typing
  from typing import Any, Optional
label_desc: Use image node_id 6 for calling a global function with example usage: _index_for_subindex(a_idx, sub_idx, shape) and returns: tuple