Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/s/e/securedrop-HEAD/securedrop/source.py   securedrop(Download)
    def async_genkey(sid, codename):
        with app.app_context():
            background.execute(lambda: crypto_util.genkeypair(sid, codename))
 
    # Generate a keypair to encrypt replies from the journalist
        entropy_avail = int(open('/proc/sys/kernel/random/entropy_avail').read())
        if entropy_avail >= 2400:
            crypto_util.genkeypair(g.sid, g.codename)
 
    g.source.last_updated = datetime.now()