I have Directed Graph in networkx. I want to only keep those nodes which have two or more than two outgoing edges or no outgoing edge at all. How do I do this?

or

How do I removes nodes which have exactly one outgoing edge in a networkx graph.

Edit
Report