def fix_integer_index(context, builder, idxty, idx, size):
    if idxty.signed:
        ind = context.cast(builder, idx, idxty, types.intp)
        ind = slicing.fix_index(builder, ind, size)
    else:
        ind = context.cast(builder, idx, idxty, types.uintp)
    return ind
Fix the integer index' type and value for the given dimension size.
dataset/ETHPy150Open numba/numba/numba/targets/arrayobj.py/fix_integer_index