How to solve problems with duplicate node labels

In [1]:
import pybel
import pybel_tools
In [2]:
pybel.get_version()
Out[2]:
'0.13.2'
In [3]:
pybel_tools.get_version()
Out[3]:
'0.7.4-dev'
In [ ]:
from pybel_tools.mutation.collapse import collapse_nodes_with_same_names
In [ ]:
# Update this path to your file
In [ ]:
graph = pybel.from_json_path(
    "/path_to_your_pickle.pickle"
)
In [ ]:
collapse_nodes_with_same_names(graph)
In [ ]:
pybel.to_pickle(graph, "collapsed_graph.pickle")