From 2af35d9c897b752acd2bb244ae398006bdf980ac Mon Sep 17 00:00:00 2001 From: Xu Yang Date: Tue, 30 May 2023 20:20:16 +0800 Subject: [PATCH] second commit --- qlib/finco/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 qlib/finco/utils.py diff --git a/qlib/finco/utils.py b/qlib/finco/utils.py new file mode 100644 index 000000000..1437ccb80 --- /dev/null +++ b/qlib/finco/utils.py @@ -0,0 +1,9 @@ +import json + +def parse_json(response): + try: + return json.loads(response) + except json.decoder.JSONDecodeError: + pass + + raise Exception(f"Failed to parse response: {response}, please report it or help us to fix it.") \ No newline at end of file