from typing import Iterable
from typing import Literal
from typing import List


def make_ner_labels(
    entity_types: Iterable[str], type_: Literal["BIO", "BILUO"] = "BIO"
) -> List[str]:
    """Make BILUO or BIO style ner label from entity type list.

    Examples:
        >>> make_ner_labels(["PERSON"])
        ["-", "O", "U-PERSON", "B-PERSON", ...]
    """
    labels = ["-", "O"]
    prefixes = [p for p in type_ if p != "O"]
    for l in entity_types:
        for pref in prefixes:
            labels.append(pref + "-" + l)
    return list(dict.fromkeys(labels))