def raise_errors_on_nested_writes(method_name, serializer, validated_data):
 assert (not any(((isinstance(field, BaseSerializer) and (field.source in validated_data) and isinstance(validated_data[field.source], (list, dict))) for field in serializer._writable_fields))), u'The `.{method_name}()` method does not support writable nested fields by default.\nWrite an explicit `.{method_name}()` method for serializer `{module}.{class_name}`, or set `read_only=True` on nested serializer fields.'.format(method_name=method_name, module=serializer.__class__.__module__, class_name=serializer.__class__.__name__)
 assert (not any((((u'.' in field.source) and (key in validated_data) and isinstance(validated_data[key], (list, dict))) for (key, field) in serializer.fields.items()))), u'The `.{method_name}()` method does not support writable dotted-source fields by default.\nWrite an explicit `.{method_name}()` method for serializer `{module}.{class_name}`, or set `read_only=True` on dotted-source serializer fields.'.format(method_name=method_name, module=serializer.__class__.__module__, class_name=serializer.__class__.__name__)

def raise_errors_on_nested_writes ( method_name , serializer , validated_data ) : assert ( not any ( ( ( isinstance ( field , BaseSerializer ) and ( field . source in validated_data ) and isinstance ( validated_data [ field . source ] , ( list , dict ) ) ) for field in serializer . _writable_fields ) ) ) , u'The `.{method_name}()` method does not support writable nested fields by default.\nWrite an explicit `.{method_name}()` method for serializer `{module}.{class_name}`, or set `read_only=True` on nested serializer fields.' . format ( method_name = method_name , module = serializer . __class__ . __module__ , class_name = serializer . __class__ . __name__ ) assert ( not any ( ( ( ( u'.' in field . source ) and ( key in validated_data ) and isinstance ( validated_data [ key ] , ( list , dict ) ) ) for ( key , field ) in serializer . fields . items ( ) ) ) ) , u'The `.{method_name}()` method does not support writable dotted-source fields by default.\nWrite an explicit `.{method_name}()` method for serializer `{module}.{class_name}`, or set `read_only=True` on dotted-source serializer fields.' . format ( method_name = method_name , module = serializer . __class__ . __module__ , class_name = serializer . __class__ . __name__ )
give explicit errors when users attempt to pass writable nested data .