code: def buildMainLoop(workbench, launcher, **kwargs):
      
      unhandledInput = partial(ui._unhandledInput,
                               workbench=workbench,
                               launcher=launcher)
      mainLoop = urwid.MainLoop(widget=workbench.widget,
                                palette=ui.DEFAULT_PALETTE,
                                unhandled_input=unhandledInput,
                                event_loop=urwid.TwistedEventLoop(),
                                **kwargs)
      return mainLoop
docs: Builds a main loop from the given workbench and launcher.
  
      The main loop will have the default pallette, as well as the
      default unused key handler. The key handler will have a reference
      to the workbench and launcher so that it can clear the screen.
  
      The extra keyword arguments are passed to the main loop.