def install():
    """
    Configure the twisted mainloop to be run inside the glib mainloop.
    """
    reactor = Glib2Reactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)

    Configure the twisted mainloop to be run inside the glib mainloop.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/glib2reactor.py