def validate_boolean(option, value):
    if isinstance(value, bool):
        return value
    raise TypeError("%s must be True or False" % (option,))
Validates that 'value' is True or False.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/validate_boolean