Merged in feature/black-and-isort (pull request #717)

Feature/black and isort

* black and isort constants

* black and isort codes

* black and isort crosswalks

* black and isort investment

* black and isort prompts

* isort testbed

* isort tracking

* black and isort utils

* poetry and black tests


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-09-30 20:56:02 +00:00
parent ae4eda6f25
commit 674add9a3e
43 changed files with 841 additions and 515 deletions
+6 -9
View File
@@ -4,18 +4,13 @@ import re
import traceback
import warnings
from datetime import datetime
from typing import Literal, overload
import numpy as np
import pandas as pd
from typing import overload, Literal
from constants.delimiters import Delimiter
from constants.regex_patterns import (
BACKTICK_PATTERN,
PIPE_PATTERN,
TRIPLE_BACKTICK_PATTERN,
)
from constants.regex_patterns import (BACKTICK_PATTERN, PIPE_PATTERN,
TRIPLE_BACKTICK_PATTERN)
def extract_text_from_delimiters(
@@ -227,7 +222,9 @@ def universal_json_load(string_dict: str):
try:
# Clean up the string list before parsing
cleaned_str = re.sub(r'(?<!\\)"', '"', matched_str) # Handle escaped quotes
cleaned_str = re.sub(r"'", '"', cleaned_str) # Replace single quotes with double quotes
cleaned_str = re.sub(
r"'", '"', cleaned_str
) # Replace single quotes with double quotes
return json.loads(cleaned_str)
except json.JSONDecodeError as e: