code: def run_on_new_thread(func, daemon=True):
      
      f = concurrent.futures.Future()
      def wrapper():
          if not f.set_running_or_notify_cancel():
              return
          try:
              f.set_result(func())
          except Exception as e:
              f.set_exception(e)
      t = threading.Thread(target=wrapper)
      t.daemon = daemon
      t.start()
      return f
docs: Calls `func()` from a new thread.
  
      :param daemon: Specifies whether the thread should be in daemon mode.
  
      :returns: A concurrent.futures.Future object representing the result.