# Path: tornado/ioloop.py
# class IOLoop(object):
# class _Timeout(object):
# class PeriodicCallback(object):
# class _EPoll(object):
# class _KQueue(object):
# class _Select(object):
#     _EPOLLIN = 0x001
#     _EPOLLPRI = 0x002
#     _EPOLLOUT = 0x004
#     _EPOLLERR = 0x008
#     _EPOLLHUP = 0x010
#     _EPOLLRDHUP = 0x2000
#     _EPOLLONESHOT = (1 << 30)
#     _EPOLLET = (1 << 31)
#     NONE = 0
#     READ = _EPOLLIN
#     WRITE = _EPOLLOUT
#     ERROR = _EPOLLERR | _EPOLLHUP | _EPOLLRDHUP
#     _EPOLL_CTL_ADD = 1
#     _EPOLL_CTL_DEL = 2
#     _EPOLL_CTL_MOD = 3
#     def __init__(self, impl=None):
#     def instance():
#     def initialized():
#     def install(self):
#     def close(self, all_fds=False):
#     def add_handler(self, fd, handler, events):
#     def update_handler(self, fd, events):
#     def remove_handler(self, fd):
#     def set_blocking_signal_threshold(self, seconds, action):
#     def set_blocking_log_threshold(self, seconds):
#     def log_stack(self, signal, frame):
#     def start(self):
#     def stop(self):
#     def running(self):
#     def add_timeout(self, deadline, callback):
#     def remove_timeout(self, timeout):
#     def add_callback(self, callback):
#     def _run_callback(self, callback):
#     def handle_callback_exception(self, callback):
#     def __init__(self, deadline, callback):
#     def timedelta_to_seconds(td):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __init__(self, callback, callback_time, io_loop=None):
#     def start(self):
#     def stop(self):
#     def _run(self):
#     def _schedule_next(self):
#     def __init__(self):
#     def fileno(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def poll(self, timeout):
#     def __init__(self):
#     def fileno(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def _control(self, fd, events, flags):
#     def poll(self, timeout):
#     def __init__(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def poll(self, timeout):
# 
# Path: tornado/process.py
# def cpu_count():
# def _reseed_random():
# def fork_processes(num_processes, max_restarts=100):
#     def start_child(i):
# def task_id():


import functools
import logging
import os
import pkgutil
import sys
import types
import subprocess
    import signal
            import runpy
from tornado import ioloop
from tornado import process

    All imported modules are watched by default.
    """
    _watched_files.add(filename)

_reload_hooks = []

def add_reload_hook(fn):
    """Add a function to be called before reloading the process.

    Note that for open file and socket handles it is generally
    preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or
    `tornado.platform.auto.set_close_exec`) instead of using a reload
    hook to close them.
    """
    _reload_hooks.append(fn)

def _close_all_fds(io_loop):
    for fd in io_loop._handlers.keys():
        try:
            os.close(fd)
        except Exception:
            pass

_reload_attempted = False

def _reload_on_update(modify_times):
    if _reload_attempted:
        # We already tried to reload and it didn't work, so don't try again.
        return

# Path: tornado/ioloop.py
# class IOLoop(object):
# class _Timeout(object):
# class PeriodicCallback(object):
# class _EPoll(object):
# class _KQueue(object):
# class _Select(object):
#     _EPOLLIN = 0x001
#     _EPOLLPRI = 0x002
#     _EPOLLOUT = 0x004
#     _EPOLLERR = 0x008
#     _EPOLLHUP = 0x010
#     _EPOLLRDHUP = 0x2000
#     _EPOLLONESHOT = (1 << 30)
#     _EPOLLET = (1 << 31)
#     NONE = 0
#     READ = _EPOLLIN
#     WRITE = _EPOLLOUT
#     ERROR = _EPOLLERR | _EPOLLHUP | _EPOLLRDHUP
#     _EPOLL_CTL_ADD = 1
#     _EPOLL_CTL_DEL = 2
#     _EPOLL_CTL_MOD = 3
#     def __init__(self, impl=None):
#     def instance():
#     def initialized():
#     def install(self):
#     def close(self, all_fds=False):
#     def add_handler(self, fd, handler, events):
#     def update_handler(self, fd, events):
#     def remove_handler(self, fd):
#     def set_blocking_signal_threshold(self, seconds, action):
#     def set_blocking_log_threshold(self, seconds):
#     def log_stack(self, signal, frame):
#     def start(self):
#     def stop(self):
#     def running(self):
#     def add_timeout(self, deadline, callback):
#     def remove_timeout(self, timeout):
#     def add_callback(self, callback):
#     def _run_callback(self, callback):
#     def handle_callback_exception(self, callback):
#     def __init__(self, deadline, callback):
#     def timedelta_to_seconds(td):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __init__(self, callback, callback_time, io_loop=None):
#     def start(self):
#     def stop(self):
#     def _run(self):
#     def _schedule_next(self):
#     def __init__(self):
#     def fileno(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def poll(self, timeout):
#     def __init__(self):
#     def fileno(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def _control(self, fd, events, flags):
#     def poll(self, timeout):
#     def __init__(self):
#     def close(self):
#     def register(self, fd, events):
#     def modify(self, fd, events):
#     def unregister(self, fd):
#     def poll(self, timeout):
# 
# Path: tornado/process.py
# def cpu_count():
# def _reseed_random():
# def fork_processes(num_processes, max_restarts=100):
#     def start_child(i):
# def task_id():


# Path: tornado/autoreload.py
import functools
import logging
import os
import pkgutil
import sys
import types
import subprocess
    import signal
            import runpy
from tornado import ioloop
from tornado import process


    All imported modules are watched by default.
    """
    _watched_files.add(filename)

_reload_hooks = []

def add_reload_hook(fn):
    """Add a function to be called before reloading the process.

    Note that for open file and socket handles it is generally
    preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or
    `tornado.platform.auto.set_close_exec`) instead of using a reload
    hook to close them.
    """
    _reload_hooks.append(fn)

def _close_all_fds(io_loop):
    for fd in io_loop._handlers.keys():
        try:
            os.close(fd)
        except Exception:
            pass

_reload_attempted = False

def _reload_on_update(modify_times):
    if _reload_attempted:
        # We already tried to reload and it didn't work, so don't try again.
        return

    if process.task_id() is not None: