def validate_read_preference_mode(dummy, name):
    try:
        return read_pref_mode_from_name(name)
    except ValueError:
        raise ValueError("%s is not a valid read preference" % (name,))
Validate read preference mode for a MongoReplicaSetClient.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/validate_read_preference_mode