How to only retain intersection and stop sign nodes

I am using osmnx with Python to generate a graph and find routes. By default, retain_all is set to False, meaning the graph will retain all connected roads but will only display the “largest weakly connected components” (intersection nodes/road endings). If I set retain_all equal to True, the graph will retain all nodes, including stoplights (graphed on the street, not to the side) and nodes defining the curve of a road.

Is there a way to only retain the intersection nodes and the stop signs? I am trying to create a path that recognizes the stop signs as well, but if I add the stop sign nodes after creating the graph they are not detected as part of the network because they have no edges.