def new_codename(client, session):
 with client as c:
  c.get('/generate')
  codename = session['codename']
  c.post('/create')
 return codename

def new_codename ( client , session ) : with client as c : c . get ( '/generate' ) codename = session [ 'codename' ] c . post ( '/create' ) return codename
helper function to go through the "generate codename" flow .