Control Rig, select all input nodes, python where/how?

Hey guys, when you are working in Control rig, you can right click on a nodes input pin and click on “Select All Input Nodes” and it then selects all the input nodes.
image
My question… is there a python command equivalent for this?