@cron('*/15 * * * *')
def auto_retweet(bot):
    conn = bot.get_social_connection(id='twitter')
    dirname = os.path.expanduser('~/.irc3/twitter/{nick}'.format(**bot.config))

    if not os.path.isdir(dirname):
        os.makedirs(dirname)

    filename = os.path.join(dirname, 'retweeted')
    if os.path.isfile(filename):
        with open(filename) as fd:
            retweeted = [i.strip() for i in fd.readlines()]
    else:
        retweeted = []

    for user in ('pypi', 'gawel_'):
        results = conn.search.tweets(
            q=user + ' AND irc3',
            result_type='recent')
        for item in results.get('statuses', []):
            if item['user']['screen_name'] == user:
                if item['id_str'] not in retweeted:
                    res = conn(getattr(conn.statuses.retweet, item['id_str']))
                    if 'id' in res:
                        with open(filename, 'a+') as fd:
                            fd.write(item['id_str'] + '\n')
Copies (i.e., clones) a key stored by barbican.
dataset/ETHPy150Open gawel/irc3/examples/freenode_irc3.py/auto_retweet--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/keymgr/barbican.py/BarbicanKeyManager.copy_key