MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / check_test

Function check_test

_cluster_utils.py:28–46  ·  view source on GitHub ↗
(entities)

Source from the content-addressed store, hash-verified

26ENCODER = None
27
28def check_test(entities):
29 e_l=[]
30 max_len=len(entities)
31 for layer in entities:
32 temp_e=[]
33 if type(layer) != list:
34 temp_e.append(layer['entity_name'])
35 e_l.append(temp_e)
36 continue
37 for item in layer:
38 temp_e.append(item['entity_name'])
39 e_l.append(temp_e)
40
41 for index,layer in enumerate(entities):
42 if type(layer) != list or index==max_len-1:
43 break
44 for item in layer:
45 if item['parent'] not in e_l[index+1]:
46 print(item['entity_name'],item['parent'])
47def extract_first_complete_json(s: str):
48 """Extract the first complete JSON object from the string using a stack to track braces."""
49 stack = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected