'Primary function which handles recursively transforming
values via their serializers'

def transform(self, value, **kwargs):

    if (value is None):
        return None
    objid = id(value)
    if (objid in self.context):
        return '<...>'
    self.context.add(objid)
    try:
        for serializer in self.serializers:
            if serializer.can(value):
                try:
                    return serializer.serialize(value, **kwargs)
                except Exception as e:
                    logger.exception(e)
                    return text_type(type(value))
        try:
            return repr(value)
        except Exception as e:
            logger.exception(e)
            return text_type(type(value))
    finally:
        self.context.remove(objid)
