class RawJavaScriptText:

    def __init__(self, jstext):
        self._jstext = jstext

def get_jstext(self):
    return self._jstext


class RawJsJSONEncoder(json.JSONEncoder):

    def __init__(self, *args, **kwargs):
        json.JSONEncoder.__init__(self, *args, **kwargs)
Custom JSON Encoder in Python With Precomputed Literal JSON