INNER CODE UNIT · Python
namespace_index
awslabs/awsome-distributed-ai · .github/scripts/stage-template-publish.py:85
namespace_index = architecture_index + 1
if namespace_index >= len(parts):
return None
return parts[namespace_index]
def validate_references(cfn_sources: list[Path], destination_keys: set[str]) -> list[str]:
errors: list[str] = []
for source in cfn_sources:
text = source.read_text(encoding="utf-8")
refs = set(PREFIX_REF_RE.findall(text)) | set(PUBLIC_URL_RE.findall(text))
namespace = architecture_namespace(source)
for ref in sorted(refs):
namespaced_ref = f"{namespace}/{ref}" if namespace else None
if ref not in destination_keys and namespaced_ref not in destination_keys:
errors.append(f"{source}: references '{ref}', but no manifest entry publishes that key")
return errors