def unlock(f):
@click.pass_context<EOL>def new_func(ctx, *args, **kwargs):<EOL><INDENT>if not ctx.obj.get("<STR_LIT>", False):<EOL><INDENT>if ctx.peerplays.wallet.created():<EOL><INDENT>while True:<EOL><INDENT>if "<STR_LIT>" in os.environ:<EOL><INDENT>pwd = os.environ["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>pwd = click.prompt("<STR_LIT>", hide_input=True)<EOL><DEDENT>try:<EOL><INDENT>ctx.peerplays.wallet.unlock(pwd)<EOL><DEDENT>except WrongMasterPasswordException:<EOL><INDENT>click.echo("<STR_LIT>")<EOL>continue<EOL><DEDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>click.echo("<STR_LIT>")<EOL>pwd = click.prompt(<EOL>"<STR_LIT>",<EOL>hide_input=True,<EOL>confirmation_prompt=True,<EOL>)<EOL>ctx.peerplays.wallet.create(pwd)<EOL><DEDENT><DEDENT>return ctx.invoke(f, *args, **kwargs)<EOL><DEDENT>return update_wrapper(new_func, f)<EOL>
This decorator will unlock the wallet by either asking for a
        passphrase or taking the environmental variable ``UNLOCK``