def validate_read_preference(dummy, value):
    if not isinstance(value, _ServerMode):
        raise TypeError("%r is not a read preference." % (value,))
    return value
Validate a read preference.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/validate_read_preference