code: def toggle_keyboard(cls, flag=HIDE_IMPLICIT_ONLY):
          
          app = AndroidApplication.instance()
          f = app.create_future()
  
          def on_ready(ims):
              ims.toggleSoftInput(flag, 0)
              f.set_result(True)
  
          cls.get().then(on_ready)
          return f
docs: Toggle the keyboard on and off
           
          Parameters
          ----------
              flag: int
                  Flag to send to toggleSoftInput
           
          Returns
          --------
              result: future
                  Resolves when the toggle is complete