Port assignment verdicts
Your task
A deployment tool audits the port assignments in a service config. Every entry is written as a service name, one equals sign, then a value, with no spaces, for example api=8080. Return one verdict per entry in the same order, written as the name, then a colon, then the verdict word. A value that is not a run of digits, or a number above 65535, is not a port at all and its verdict is invalid. Otherwise read the number, where leading zeros are allowed, and give the verdict conflict when an earlier entry already claimed that same port number. Otherwise the verdict names the range the port falls in: well-known for 0 through 1023, registered for 1024 through 49151, ephemeral for 49152 through 65535. Only an entry that holds a real port claims one.
Examples
audit_service_ports(entries: list[str]) -> list[str]audit_service_ports(["http=80", "api=8080", "cache=49999"])["http:well-known", "api:registered", "cache:ephemeral"]audit_service_ports(["debug=eighty", "metrics=70000"])["debug:invalid", "metrics:invalid"]audit_service_ports(["a=443", "b=0443"])["a:well-known", "b:conflict"]