code: def testRunUIWithOnUIExitCallback(self):
      observer = {"callback_invoked": False}
  
      def callback_for_test():
          observer["callback_invoked"] = True
  
      ui = MockReadlineUI(
          on_ui_exit=callback_for_test, command_sequence=["exit"]
      )
  
      self.assertFalse(observer["callback_invoked"])
      ui.run_ui()
  
      self.assertEqual(0, len(ui.observers["screen_outputs"]))
      self.assertTrue(observer["callback_invoked"])
  
imports: import os
  import argparse
  import tempfile
  from tensorflow.python.debug.cli import cli_config
  from tensorflow.python.debug.cli import debugger_cli_common
  from tensorflow.python.debug.cli import readline_ui
  from tensorflow.python.debug.cli import ui_factory
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 12 for calling the CursesTest obj's underlying member method code with example usage: obj.testRunUIWithOnUIExitCallback() without return types