Remove `assert` for flow control; it can be optimized away with `python -O`.

Change-Id: Iaa3b9e5d6234db0c2a68992c8ef17dd90de59e40
Fixes-bug: 1373538
Merge "Remove `assert` for flow control; it can be optimized away with `python -O`."