def _validate_type_key(key, value, types, validated):
    """Validate a key's value by type."""
    for key_schema, value_schema in types.items():
        if not isinstance(key, key_schema):
            continue
        try:
            validated[key] = value_schema(value)
        except NotValid:
            continue
        else:
            return []

    return ['%r: %r not matched' % (key, value)]
def _validate_type_key ( key , value , types , validated ) : for key_schema , value_schema in types . items ( ) : if not isinstance ( key , key_schema ) : continue try : validated [ key ] = value_schema ( value ) except NotValid : continue else : return [ ] return [ '%r: %r not matched' % ( key , value ) ]
Validate a key's value by type.