def render_response(self, request, context, _route):
        from collections import Sized
        if isinstance(context, basestring):  # already serialized
            if self._guess_json(context):
                return Response(context, mimetype="application/json")
            elif '<html' in context[:168]:
                # based on the longest DOCTYPE I found in a brief search
                return Response(context, mimetype="text/html")
            else:
                return Response(context, mimetype="text/plain")

        # not serialized yet, time to guess what the requester wants
        if not isinstance(context, Sized):
            return Response(unicode(context), mimetype="text/plain")
        return self._serialize_to_resp(context, request, _route)
dataset/ETHPy150Open mahmoud/boltons/misc/table_html_app.py/BasicRender.render_response/original