def get_validated_options(options, warn=True):
    validated_options = {}
    for opt, value in iteritems(options):
        lower = opt.lower()
        try:
            validator = URI_VALIDATORS.get(lower, raise_config_error)
            value = validator(opt, value)
        except (ValueError, ConfigurationError) as exc:
            if warn:
                warnings.warn(str(exc))
            else:
                raise
        else:
            validated_options[lower] = value
    return validated_options
Validate each entry in options and raise a warning if it is not valid.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/get_validated_options