# Path: transmute_core/exceptions.py
# class SerializationException(APIException):
#     """
#     this exceptions signifies an exception with
#     serializing values.
#     """
# 
# Path: transmute_core/compat.py
# def getfullargspec(func):


from .interface import ObjectSerializer
from collections import OrderedDict
from datetime import datetime
from schematics.types import (
    BaseType,
    BooleanType,
    DecimalType,
    FloatType,
    IntType,
    NumberType,
    StringType,
    Serializable,
    DateTimeType,
    UUIDType,
    URLType,
)
from schematics.models import ModelMeta, Model
from schematics.types.compound import ListType, ModelType, DictType
from schematics.exceptions import BaseError, ConversionError
from schematics.transforms import get_import_context
from ..exceptions import SerializationException
from decimal import Decimal
from ..compat import all_string_types
        return self._models.get(model, model)

    @staticmethod
    def _to_key(model):
        if isinstance(model, list):
            return tuple(model)
        return model

    def load(self, model, value):
        model = _enforce_type_instance_or_model_class(model)
        try:
            context = get_import_context(oo=True)
            model = self._translate_to_model(model)
            result = model(value, context=context)
            if isinstance(model, ModelType) or not isinstance(model, BaseType):
                result.validate()
            else:
                model.validate(result, context=context)
            return result
        except BaseError as e:
            raise SerializationException(str(e))
        except ConversionError as e:
            raise SerializationException(str(e))

    def dump(self, model, value):
        model = _enforce_type_instance_or_model_class(model)
        try:
            model = self._translate_to_model(model)
            return model.to_primitive(value)
        except BaseError as e:

# Path: transmute_core/exceptions.py
# class SerializationException(APIException):
#     """
#     this exceptions signifies an exception with
#     serializing values.
#     """
# 
# Path: transmute_core/compat.py
# def getfullargspec(func):


# Path: transmute_core/object_serializers/schematics_serializer.py
from .interface import ObjectSerializer
from collections import OrderedDict
from datetime import datetime
from schematics.types import (
    BaseType,
    BooleanType,
    DecimalType,
    FloatType,
    IntType,
    NumberType,
    StringType,
    Serializable,
    DateTimeType,
    UUIDType,
    URLType,
)
from schematics.models import ModelMeta, Model
from schematics.types.compound import ListType, ModelType, DictType
from schematics.exceptions import BaseError, ConversionError
from schematics.transforms import get_import_context
from ..exceptions import SerializationException
from decimal import Decimal
from ..compat import all_string_types

        return self._models.get(model, model)

    @staticmethod
    def _to_key(model):
        if isinstance(model, list):
            return tuple(model)
        return model

    def load(self, model, value):
        model = _enforce_type_instance_or_model_class(model)
        try:
            context = get_import_context(oo=True)
            model = self._translate_to_model(model)
            result = model(value, context=context)
            if isinstance(model, ModelType) or not isinstance(model, BaseType):
                result.validate()
            else:
                model.validate(result, context=context)
            return result
        except BaseError as e:
            raise SerializationException(str(e))
        except ConversionError as e:
            raise SerializationException(str(e))

    def dump(self, model, value):
        model = _enforce_type_instance_or_model_class(model)
        try:
            model = self._translate_to_model(model)
            return model.to_primitive(value)
        except BaseError as e:

            raise SerializationException(str(e))