def METHOD_NAME(self, validated_data):
    user = User.objects.METHOD_NAME(username=validated_data['username'])
    user.set_password(validated_data['password'])
    if validated_data.get('email'):
        user.email = validated_data['email']
    user.save()
    return user