I have two lines of code as below:
Hides all the curves not selected:
mel.eval('isolateAnimCurve true graphEditor1FromOutliner graphEditor1GraphEd;')
Brings back all the curves:
mel.eval('isolateAnimCurve false graphEditor1FromOutliner graphEditor1GraphEd;')
Need a to put in a function (python) where it can be toggled, so I can use it as a hotkey in maya.