From 9e1be12e4acb41e87d43b3f03f18d22d1f5cc510 Mon Sep 17 00:00:00 2001 From: tackhwa <55059307+tackhwa@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:07:34 +0800 Subject: [PATCH] fix lint --- lightrag/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lightrag/utils.py b/lightrag/utils.py index 165d7106..78ee6472 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -417,21 +417,21 @@ def extract_fixed_parenthesized_content(records: list[str]) -> list[str]: for record in records: # First, extract properly matched pairs - balanced_matches = re.findall(r'\((.*?)\)', record) + balanced_matches = re.findall(r"\((.*?)\)", record) for match in balanced_matches: result.append(f"({match})") - + # Process string to handle unbalanced parentheses # For opening without closing - open_matches = re.findall(r'\(([^()]*?)$', record) + open_matches = re.findall(r"\(([^()]*?)$", record) for match in open_matches: result.append(f"({match})") - + # For closing without opening - close_matches = re.findall(r'^([^()]*?)\)', record) + close_matches = re.findall(r"^([^()]*?)\)", record) for match in close_matches: result.append(f"({match})") - + return result