# SPDX-License-Identifier: MIT
# Independently authored membership and boolean/integer comparison cases.
for needle in ['', 'a', 'é', '🙂', 'é🙂', 'x', 'aé🙂x']:
    print(needle in 'aé🙂', needle not in 'aé🙂')
for text in ['', 'a', 'é🙂']:
    print('' in text, 'x' not in text)
for needle_bytes in [b'', b'\x00', b'\xff', b'\x00\xff', b'x']:
    print(needle_bytes in b'a\x00\xff', needle_bytes not in b'a\x00\xff')
for byte in [-1, 0, 1, 97, 255, 256, 999999999999999999999]:
    try:
        print(byte in b'a\x00\xff', byte not in b'')
    except ValueError as error:
        print(repr(error))
print(False in b'\x00', True in b'\x01', True in b'\x00')
for item in [-1, 0, 1, 2, 3]:
    print(item in (0,1,2), item not in (0,1,2), item in ())
print(1 in ('a',True,None), 'a' in (1,'a',None), b'a' in ('a',1,None))
print((1,2) in ((0,1),(1,2)), (1,3) not in ((0,1),(1,2)))
print(int('a' in 'a'), int(1 in (1,)), int(1 not in (1,)))
print(1 == True, True == 1, False == 0, True > 0, -1 < False, True <= 1)
print('a' == b'a', None == 0, 0 != None, '1' == 1, 1 == '1')
class Box:
    pass
box=Box()
other=Box()
print(box in (box,), other in (box,))
def needle_value():
    print('needle')
    return 1
def tuple_value():
    print('container')
    return (1,2)
print(needle_value() in tuple_value())
print([True]==[1], [False]==[0], [1]==['1'], [[1],[2]]==[[1],[2]])
lookup=[0,1,1,2]
print(lookup.count(True),lookup.index(True),lookup.count('1'),True in lookup)
lookup.remove(True)
print(lookup)
