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