# 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
"""

from __future__ import with_statement



try:
except ImportError:
    signal = None

def start(io_loop=None, check_time=500):
    """Restarts the process automatically when a module is modified.

    We run on the I/O loop, and restarting is a destructive operation,
    so will terminate any pending requests.
    """
    io_loop = io_loop or ioloop.IOLoop.instance()
    add_reload_hook(functools.partial(_close_all_fds, io_loop))
    modify_times = {}
    callback = functools.partial(_reload_on_update, modify_times)
    scheduler = ioloop.PeriodicCallback(callback, check_time, io_loop=io_loop)
    scheduler.start()

def wait():
    """Wait for a watched file to change, then restart the process.

    Intended to be used at the end of scripts like unit test runners,
    to run the tests again after any source file changes (but see also
    the command-line interface in `main`)
    """

# 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

"""

from __future__ import with_statement



try:
except ImportError:
    signal = None

def start(io_loop=None, check_time=500):
    """Restarts the process automatically when a module is modified.

    We run on the I/O loop, and restarting is a destructive operation,
    so will terminate any pending requests.
    """
    io_loop = io_loop or ioloop.IOLoop.instance()
    add_reload_hook(functools.partial(_close_all_fds, io_loop))
    modify_times = {}
    callback = functools.partial(_reload_on_update, modify_times)
    scheduler = ioloop.PeriodicCallback(callback, check_time, io_loop=io_loop)
    scheduler.start()

def wait():
    """Wait for a watched file to change, then restart the process.

    Intended to be used at the end of scripts like unit test runners,
    to run the tests again after any source file changes (but see also
    the command-line interface in `main`)
    """

    io_loop = ioloop.IOLoop()