def array_slice(self, arr, indices):
    data_ptr = self.attr(arr, "data")
    shape = self.attr(arr, "shape")
    strides = self.attr(arr, "strides")
    elt_offset = self.attr(arr, "offset")
    size = self.attr(arr, "size")

    new_strides = []
    new_shape = []

    for (i, idx) in enumerate(indices):
      stride_i = self.tuple_proj(strides, i)
      shape_i = self.tuple_proj(shape, i)
      idx_t = idx.type
      if isinstance(idx_t, ScalarT):
        offset_i = self.mul(idx, stride_i, "offset_%d" % i)
        elt_offset = self.add(elt_offset, offset_i)
      elif idx_t.__class__ is NoneT:
        new_strides.append(stride_i)
        new_shape.append(shape_i)
      elif idx_t.__class__ is SliceT:
        if isinstance(idx_t.start_type, NoneT):
          start =  zero_i64
        else:
          start = self.attr(idx, "start")
        
        if isinstance(idx_t.step_type, NoneT):
          step = one_i64
        else:
          step = self.attr(idx, "step")
        
        if isinstance(idx_t.stop_type, NoneT):
          stop = shape_i
        else:
          stop = self.attr(idx, "stop")
        
        offset_i = self.mul(start, stride_i, "offset_%d" % i)
        elt_offset = self.add(elt_offset, offset_i)
        dim_i = self.sub(stop, start, "dim_%d" % i)
        # don't forget to cast shape elements to int64
        new_shape.append(self.cast(dim_i, Int64))
        new_strides.append(self.mul(stride_i, step))
      else:
        raise RuntimeError(idx_t % "Unsupported index type: %s")

    elt_t = arr.type.elt_type
    new_rank = len(new_strides)
    new_array_t = make_array_type(elt_t, new_rank)
    new_strides = self.tuple(new_strides, "strides")
    new_shape = self.tuple(new_shape, "shape")
    return ArrayView(data_ptr, new_shape, new_strides,
                            elt_offset, size,
                            type = new_array_t)
dataset/ETHPy150Open iskandr/parakeet/parakeet/transforms/lower_indexing.py/LowerIndexing.array_slice/swapped operands of `%`