def DefaultSelector():
    """ This function serves as a first call for DefaultSelector to
    detect if the select module is being monkey-patched incorrectly
    by eventlet, greenlet, and preserve proper behavior. """
    global _DEFAULT_SELECTOR
    if _DEFAULT_SELECTOR is None:
        if platform.python_implementation() == 'Jython':  # Platform-specific: Jython
            _DEFAULT_SELECTOR = JythonSelectSelector
        elif _can_allocate('kqueue'):
            _DEFAULT_SELECTOR = KqueueSelector
        elif _can_allocate('devpoll'):
            _DEFAULT_SELECTOR = DevpollSelector
        elif _can_allocate('epoll'):
            _DEFAULT_SELECTOR = EpollSelector
        elif _can_allocate('poll'):
            _DEFAULT_SELECTOR = PollSelector
        elif hasattr(select, 'select'):
            _DEFAULT_SELECTOR = SelectSelector
        else:  # Platform-specific: AppEngine
            raise RuntimeError('Platform does not have a selector.')
    return _DEFAULT_SELECTOR()
def DefaultSelector ( ) : global _DEFAULT_SELECTOR if _DEFAULT_SELECTOR is None : if platform . python_implementation ( ) == 'Jython' : _DEFAULT_SELECTOR = JythonSelectSelector elif _can_allocate ( 'kqueue' ) : _DEFAULT_SELECTOR = KqueueSelector elif _can_allocate ( 'devpoll' ) : _DEFAULT_SELECTOR = DevpollSelector elif _can_allocate ( 'epoll' ) : _DEFAULT_SELECTOR = EpollSelector elif _can_allocate ( 'poll' ) : _DEFAULT_SELECTOR = PollSelector elif hasattr ( select , 'select' ) : _DEFAULT_SELECTOR = SelectSelector else : raise RuntimeError ( 'Platform does not have a selector.' ) return _DEFAULT_SELECTOR ( )
This function serves as a first call for DefaultSelector to
    detect if the select module is being monkey-patched incorrectly
    by eventlet, greenlet, and preserve proper behavior.