def predecessors(DiGraph, X):
    """
    returns successors of a node or the union of several nodes
    """

    if X in DiGraph:
        return DiGraph.predecessors(X)
    else:
        preds = set([])
        for x in X: preds.update(set(DiGraph.predecessors(x)))
        return sorted(preds)