def default(restart_cb=None, restart_func=None, close_fds=True):
    '''Sets up lazarus in default mode.

    See the :py:func:`custom` function for a more powerful mode of use.

    The default mode of lazarus is to watch all modules rooted at
    ``PYTHONPATH`` for changes and restart when they take place.

    Keyword arguments:

        restart_cb -- Callback invoked prior to restarting the process; allows
        for any cleanup to occur prior to restarting. Returning anything other
        than *None* in the callback will cancel the restart.

        restart_func -- Function invoked to restart the process. This supplants
        the default behavior of using *sys.executable* and *sys.argv*.

        close_fds -- Whether all file descriptors other than *stdin*, *stdout*,
        and *stderr* should be closed

    A simple example:

        >>> import lazarus
        >>> lazarus.default()
        >>> lazarus.stop()
    '''
    if _active:
        msg = 'lazarus is already active'
        raise RuntimeWarning(msg)

    _python_path = os.getenv('PYTHONPATH')
    if not _python_path:
        msg = 'PYTHONPATH is not set'
        raise RuntimeError(msg)

    if restart_cb and not callable(restart_cb):
        msg = 'restart_cb keyword argument is not callable'
        raise TypeError(msg)

    if restart_func and not callable(restart_func):
        msg = 'restart_func keyword argument is not callable'
        raise TypeError(msg)

    global _close_fds
    _close_fds = close_fds

    try:
        from watchdog.observers import Observer
        from watchdog.events import FileSystemEventHandler
    except __HOLE__ as ie:
        msg = 'no watchdog support (%s)' % str(ie)
        raise RuntimeError(msg)

    class _Handler(FileSystemEventHandler):

        def __init__(self):
            self.active = True

        def dispatch(self, event):
            if not self.active:
                return
            super(_Handler, self).dispatch(event)

        def all_events(self, event):
            if is_restart_event(event):
                cancelled = _restart()
                if not cancelled:
                    self.active = False

        def on_created(self, event):
            self.all_events(event)

        def on_deleted(self, event):
            self.all_events(event)

        def on_modified(self, event):
            self.all_events(event)

        def on_moved(self, event):
            self.all_events(event)

    global _observer
    _observer = Observer()
    handler = _Handler()
    _observer.schedule(handler, _python_path, recursive=True)
    global _restart_cb
    _restart_cb = restart_cb
    global _restart_func
    _restart_func = restart_func

    _activate()
    _observer.start()
dataset/ETHPy150Open formwork-io/lazarus/lazarus/__init__.py/default