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