def send_template(sender, recipient, template, template_data,
                  smtp_server='smtp.gmail.com', smtp_port=587):
    if args.dry_run:
        print 'Dry run -> not sending mail to %s' % recipient
    else:
        get_password(sender['login'])
        print recipient % '-> %s'

    template_data['email'] = recipient
    message = _from_template('../mail/templates/' + template, template_data)

    if args.dry_run:
        print "=" * 80
        print message
        print "=" * 80

        return

    session = smtplib.SMTP(smtp_server, smtp_port)

    session.ehlo()
    session.starttls()
    session.ehlo
    session.login(sender['login'], password)

    session.sendmail(sender['name'], recipient, message)
    session.quit()
dataset/ETHPy150Open scipy-conference/scipy_proceedings/publisher/mail/_mailer.py/send_template/swapped operands of `%`