code: def run_application_generator(self, coroutine, render_cli_done=False):
          
          # Draw interface in 'done' state, or erase.
          if render_cli_done:
              self._return_value = True
              self._redraw()
              self.renderer.reset()  # Make sure to disable mouse mode, etc...
          else:
              self.renderer.erase()
          self._return_value = None
  
          # Loop through the generator.
          g = coroutine()
          assert isinstance(g, types.GeneratorType)
  
          def step_next(send_value=None):
              " Execute next step of the coroutine."
              try:
                  # Run until next yield, in cooked mode.
                  with self.input.cooked_mode():
                      result = g.send(send_value)
              except StopIteration:
                  done()
              except:
                  done()
                  raise
              else:
                  # Process yielded value from coroutine.
                  assert isinstance(result, Application)
                  self.run_sub_application(result, done_callback=step_next,
                                           _from_application_generator=True)
  
          def done():
              # Redraw interface again.
              self.renderer.reset()
              self.renderer.request_absolute_cursor_position()
              self._redraw()
  
          # Start processing coroutine.
          step_next()
docs: EXPERIMENTAL
          Like `run_in_terminal`, but takes a generator that can yield Application instances.
  
          Example:
  
              def f():
                  yield Application1(...)
                  print('...')
                  yield Application2(...)
              cli.run_in_terminal_async(f)
  
          The values which are yielded by the given coroutine are supposed to be
          `Application` instances that run in the current CLI, all other code is
          supposed to be CPU bound, so except for yielding the applications,
          there should not be any user interaction or I/O in the given function.