There is no need to litter the code with this check everywhere. Just put `@not_implemented_for('undirected')` from `networkx.utils` on the entry points.