if condition:
    pass
elif other_condition:
    if another_one:
        pass
    if True: a = 1      # <- move statement up here
    else: b = 2

if condition:
    pass
elif other_condition:
    if another_one:
        pass
    if True: a = 1      # <- move statement up here
    else: b = 2

# <- move statement up here