def in_labelset(xmrs, nodeids, label=None):
    """
    Test if all nodeids share a label.

    Args:
        nodeids: An iterable of nodeids.
        label: If given, all nodeids must share this label.
    Returns:
        True if all nodeids share a label, otherwise False.
    """
    nodeids = set(nodeids)
    if label is None:
        label = xmrs.ep(next(iter(nodeids))).label
    return nodeids.issubset(xmrs._vars[label]['refs']['LBL'])