MAINT: break up a long function in _graph_transform in a way that may be more reusable
MAINT: remove an unused function from _mjp