from typing import Union
from typing import List
from typing import Tuple


def edge_has_empty_node(
    edge: Union[List[str], Tuple[str, str]], node_ids_with_labels
) -> bool:
    """Check if edge contains an empty node."""
    return not str(node_ids_with_labels[edge[0]]) or not str(
        node_ids_with_labels[edge[1]]
    )