from typing import List


def check_if_cut(u: int, v: int, cut: List[int]) -> bool:
    """Checks if two nodes are on opposite sides of a graph partition.

    Args:
        u: The first node
        v: The second node
        cut: A set of nodes that represents one of the sides of a partition
            on the graph

    Returns:
        Whether nodes u and v are on the same side of the partition
    """
    return ((u in cut) and (not v in cut)) or ((v in cut) and (not u in cut))