def is_restart_event(event):
    '''Default logic for whether a filesystem event is a *restart event*.

    For example:

        >>> import collections
        >>> Event = collections.namedtuple('Event', 'src_path dest_path')
        >>> vim_ev = Event('foo.py', None)
        >>> is_restart_event(vim_ev)
        True
        >>> sublime_ev = Event('.subl6f0.tmp', '__main__.py')
        >>> is_restart_event(sublime_ev)
        True

    If the event's source or destination path ends in ``.py``, the event is
    considered a *restart event*. This covers most cases where a restart
    should take place like developers using editors, IDEs, or version control
    operations.
    '''
    if event.src_path.endswith('.py'):
        return True
    elif hasattr(event, 'dest_path') and event.dest_path.endswith('.py'):
        return True
    return False
Default logic for whether a filesystem event is a *restart event*.

    For example:

        >>> import collections
        >>> Event = collections.namedtuple('Event', 'src_path dest_path')
        >>> vim_ev = Event('foo.py', None)
        >>> is_restart_event(vim_ev)
        True
        >>> sublime_ev = Event('.subl6f0.tmp', '__main__.py')
        >>> is_restart_event(sublime_ev)
        True

    If the event's source or destination path ends in ``.py``, the event is
    considered a *restart event*. This covers most cases where a restart
    should take place like developers using editors, IDEs, or version control
    operations.