'Returns the serializer for the wrapped object.
Returns the serializer for the wrapped object subject to the
indicated content type.  If no serializer matching the content
type is attached, an appropriate serializer drawn from the
default serializers will be used.  If no appropriate
serializer is available, raises InvalidContentType.'

def get_serializer(self, content_type, default_serializers=None):

    default_serializers = (default_serializers or {})
    try:
        mtype = _MEDIA_TYPE_MAP.get(content_type, content_type)
        if (mtype in self.serializers):
            return (mtype, self.serializers[mtype])
        else:
            return (mtype, default_serializers[mtype])
    except (KeyError, TypeError):
        raise exception.InvalidContentType(content_type=content_type)
