Write a code example where we use `transform_view` to achieve the same result as `indexUnaryOp` in the C API.