code: def _index_intersection(
      a_idx: tuple[slice, ...],
      b_idx: tuple[slice, ...],
      shape: tuple[int, ...],
  ) -> Optional[tuple[slice, ...]]:
      # Return None if a, b are disjoint.
      assert len(a_idx) == len(b_idx)
      result = tuple(
          _slice_intersection(a, b, length)
          for a, b, length in zip(a_idx, b_idx, shape)
      )
  
      if None in result:
          return None
      else:
          return typing.cast(tuple[slice, ...], result)
  
file_path: cupy/cupyx/distributed/array/_index_arith.py
imports: import typing
  from typing import Any, Optional
label_desc: Use image node_id 5 for calling a global function with example usage: _index_intersection(a_idx, b_idx, shape) and returns: None, typing