MCPcopy
hub / github.com/safishamsi/graphify / validate_batch

Function validate_batch

worked/example/raw/validator.py:52–61  ·  view source on GitHub ↗

Validate a list of documents. Returns (valid_docs, errors).

(docs: list)

Source from the content-addressed store, hash-verified

50
51
52def validate_batch(docs: list) -> tuple:
53 """Validate a list of documents. Returns (valid_docs, errors)."""
54 valid = []
55 errors = []
56 for doc in docs:
57 try:
58 valid.append(validate_document(doc))
59 except ValidationError as e:
60 errors.append({"doc": doc.get("source", "unknown"), "error": str(e)})
61 return valid, errors

Callers

nothing calls this directly

Calls 2

validate_documentFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected