INNER CODE UNIT · Python

architecture_namespace

awslabs/awsome-distributed-ai · .github/scripts/stage-template-publish.py:79

def architecture_namespace(source: Path) -> str | None:
    parts = source.parts
    try:
        architecture_index = parts.index("architectures")
    except ValueError:
        return None
    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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…