1 2
from collections import Counter
2 2
from typing import List
3

4

5 2
def check_unique_names(names: List[str]) -> None:
6
    """Check that operator names are unique."""
7 2
    k, ct = Counter(names).most_common(1)[0]
8 2
    if ct > 1:
9 2
        raise ValueError(f"Operator names not unique: {ct} operators with name {k}")

Read our documentation on viewing source code .

Loading