def select_nodeids(xmrs, iv=None, label=None, pred=None):
    """
    Return the list of all nodeids whose respective [EP] has the
    matching *iv* (intrinsic variable), *label*, or *pred* values. If
    none match, return an empty list.
    """
    def datamatch(nid):
        ep = xmrs.ep(nid)
        return ((iv is None or ep.iv == iv) and
                (pred is None or ep.pred == pred) and
                (label is None or ep.label == label))
    return list(filter(datamatch, xmrs.nodeids()))