MCPcopy Create free account
hub / github.com/GPTScan/GPTScan / load_rule

Function load_rule

src/tasks.py:57–65  ·  view source on GitHub ↗
(rule_indexs: List[int])

Source from the content-addressed store, hash-verified

55
56
57def load_rule(rule_indexs: List[int]):
58 result = []
59 for rule in rule_indexs:
60 if os.path.exists(os.path.join("rules", rule+".yml")):
61 result.append(yaml.load(
62 open(os.path.join("rules", rule+".yml"), "r"), Loader=yaml.FullLoader))
63 else:
64 raise FileNotFoundError("No such file: {}".format(rule))
65 return result
66
67
68def load_all_rules():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected