human
Complete this python program:
def main(_argv=sys.argv, _input=raw_input, _print=print, _app=None):
assistant
#Here is the Python code you requested.

    """This is a script to enqueue global site notification emails.
    It should only be used for important transactional messages like a Terms of
    Service change. Process:
    - write your email in emails/branch.spt
    - test locally using your own database and AWS keys in local.env
    - when reviewed and merged:
    - deploy
    - `heroku run bash`
    - `queue-branch-email your_username`      # final test from production
    - `queue-branch-email all 2> queued.log`  # !!!
    - make a commit to master to empty branch.spt
    (leave an empty file [but with speclines] or tests will fail)
    - push to GitHub
    """
    if (_app is None):
        log(u'Instantiating    Application    from    gratipay.cli.dequeue_emails')
        _app = Application()
    app = _app
    def prompt(msg):
        answer = _input((msg + u'    [y/N]'))
        if (answer.lower() != u'y'):
            raise SystemExit(1)
    try:
        username = _argv[1]
    except IndexError:
        _print(u'Usage:    {0}    [username|all]'.format(_argv[0]))
        raise SystemExit
    if (username == u'all'):
        prompt(u'Are    you    ready?')
        prompt(u'Are    you    REALLY    ready?')
        prompt(u'...    ?')
        _print(u'Okay,    you    asked    for    it!')
        participants = get_recently_active_participants(app.db)
    else:
        _print(u'Okay,    just    {}.'.format(username))
        participants = app.db.all(u'SELECT    p.*::participants    FROM    participants    p    WHERE    p.username=%s', (username,))
    N = len(participants)
    _print(N)
    for p in (random.sample(participants, (5 if (N > 5) else 1)) if N else []):
        _print(u'spotcheck:    {}    ({}={})'.format(p.email_address, p.username, p.id))
    if (username == u'all'):
        prompt(u'But    really    actually    tho?    I    mean,    ...    seriously?')
    for (i, p) in enumerate(participants, start=1):
        _print(u'{:>4}    queuing    for    {}    ({}={})'.format(i, p.email_address, p.username, p.id), file=sys.stderr)
        app.email_queue.put(p, u'branch', include_unsubscribe=False, _user_initiated=False)