For the following sample:
def fuctionName(int, bool): if int in range(...): if bool == True: return False else: r
You can just compare the boolean array. For example
X = [True, False, True]
then
Y = X == False
would give you
Y = [False, True, False]