def _get_presser(fig):
 callbacks = fig.canvas.callbacks.callbacks['button_press_event']
 func = None
 for (key, val) in callbacks.items():
  if (val.func.__class__.__name__ == 'partial'):
   func = val.func
   break
 assert (func is not None)
 return func

def _get_presser ( fig ) : callbacks = fig . canvas . callbacks . callbacks [ 'button_press_event' ] func = None for ( key , val ) in callbacks . items ( ) : if ( val . func . __class__ . __name__ == 'partial' ) : func = val . func break assert ( func is not None ) return func
get our press callback .