def find_gui_and_backend(gui=None, gui_select=None):
 import matplotlib
 if (gui and (gui != 'auto')):
  backend = backends[gui]
  if (gui == 'agg'):
   gui = None
 else:
  backend = matplotlib.rcParamsOrig['backend']
  gui = backend2gui.get(backend, None)
  if (gui_select and (gui != gui_select)):
   gui = gui_select
   backend = backends[gui]
 return (gui, backend)

def find_gui_and_backend ( gui = None , gui_select = None ) : import matplotlib if ( gui and ( gui != 'auto' ) ) : backend = backends [ gui ] if ( gui == 'agg' ) : gui = None else : backend = matplotlib . rcParamsOrig [ 'backend' ] gui = backend2gui . get ( backend , None ) if ( gui_select and ( gui != gui_select ) ) : gui = gui_select backend = backends [ gui ] return ( gui , backend )
given a gui string return the gui and mpl backend .