

def process_input(self, input, baton):
    input = super(JSONPEncoder, self).process_input(input, baton)
    callback = self.get_input(baton, self.callback, None)
    if isinstance(callback, (list, tuple)):
        callback = callback[0]
    if (not callback):
        if self.fallback_to_json:
            return input
        else:
            raise ValueError('expected to find a callback')
    return ('%s(%s)' % (callback.encode('ascii'), input))

dataset/ETHPy150Open foundit/Piped/piped/processors/json_processors.py JSONPEncoder.process_input/original