def METHOD_NAME(
    libalias: str,
    cn: str,
    component_prefixes: set[str],
    additional_prefix: str,
):
    prefixes = component_prefixes - {cn}
    if additional_prefix:
        prefixes = prefixes - {additional_prefix}
    for p in prefixes:
        if libalias.startswith(p):
            raise click.ClickException(
                f"Invalid alias prefix '{p}' "
                + f"for template library alias of component '{cn}'"
            )