def _maybeGlobalReactor(maybeReactor):
    """
    @return: the argument, or the global reactor if the argument is L{None}.
    """
    if maybeReactor is None:
        from twisted.internet import reactor
        return reactor
    else:
        return maybeReactor

    @return: the argument, or the global reactor if the argument is L{None}.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/internet.py