def safe_result(self, result):
        "returns json encodable result"
        try:
            json.dumps(result)
        except __HOLE__:
            return repr(result)
        else:
            return result
dataset/ETHPy150Open mher/flower/flower/api/tasks.py/BaseTaskHandler.safe_result