// Outermost loop should not equal to the innermost loop of the outer
// level.
if nt_loop_num > 1:
outermost_nt_loop = ord_.index(nt_loop_num - 1)
if outermost_nt_loop == outer_level_innermost_nt_loop:
return True
outer_level_innermost_nt_loop = ord_.index(0)
After Change
for t_, ord_ in itertools.izip_longest(bl_ts, bl_ords, fillvalue=None):
// Non-trivial loops.
nt_loops = [lpe for lpe in range(le.NUM) if t_[lpe] > 1]
// Innermost non-trivial loops.
try:
innermost_nt_loop = min(nt_loops, key=lambda lpe, o=ord_: o[lpe])
except (ValueError, TypeError):
// All trivial loops, or order is None type (last level).
innermost_nt_loop = None