parameters: (self, pre_run: Optional[Callable[[], None]] = None)
docstring: Called during `run`.
  
          `self.future` should be set to the new future at the point where this
          is called in order to avoid data races. `pre_run` can be used to set a
          `threading.Event` to synchronize with UI termination code, running in
          another thread that would call `Application.exit`. (See the progress
          bar code for an example.)
docstring_summary: Called during `run`.
docstring_tokens: Called during run .
function: def _pre_run(self, pre_run: Optional[Callable[[], None]] = None) -> None:
          """
          Called during `run`.
  
          `self.future` should be set to the new future at the point where this
          is called in order to avoid data races. `pre_run` can be used to set a
          `threading.Event` to synchronize with UI termination code, running in
          another thread that would call `Application.exit`. (See the progress
          bar code for an example.)
          """
          if pre_run:
              pre_run()
  
          # Process registered "pre_run_callables" and clear list.
          for c in self.pre_run_callables:
              c()
          del self.pre_run_callables[:]
function_tokens: def _pre_run ( self , pre_run : Optional [ Callable [ [ ] , None ] ] = None ) -> None : if pre_run : pre_run ( ) # Process registered "pre_run_callables" and clear list. for c in self . pre_run_callables : c ( ) del self . pre_run_callables [ : ]