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

Function check_test

tools/utils.py:126–143  ·  view source on GitHub ↗
(entities)

Source from the content-addressed store, hash-verified

124 for d in data:
125 f.write(json.dumps(d, ensure_ascii=False) + "\n")
126def check_test(entities):## 初期用于检测是否有边界错误
127 e_l=[]
128 for layer in entities:
129 temp_e=[]
130 if type(layer) != list:
131 temp_e.append(layer['entity_name'])
132 e_l.append(temp_e)
133 continue
134 for item in layer:
135 temp_e.append(item['entity_name'])
136 e_l.append(temp_e)
137
138 for index,layer in enumerate(entities):
139 if type(layer) != list or len(layer) == 1:
140 break
141 for item in layer:
142 if item['parent'] not in e_l[index+1]:
143 print(item['entity_name'],item['parent'])
144
145class InstanceManager:
146 def __init__(self, url,ports, gpus, generate_model,startup_delay=30):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected