MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / is_valid_backend

Function is_valid_backend

ui/easydiffusion/backend_manager.py:13–23  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

11
12
13def is_valid_backend(file_path):
14 with open(file_path, "r", encoding="utf-8") as file:
15 node = ast.parse(file.read())
16
17 # Check for presence of a dictionary named 'ed_info'
18 for item in node.body:
19 if isinstance(item, ast.Assign):
20 for target in item.targets:
21 if isinstance(target, ast.Name) and target.id == "ed_info":
22 return True
23 return False
24
25
26def find_valid_backends(root_dir) -> dict:

Callers 1

find_valid_backendsFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected