def get_otp(hsm, args):
if args.no_otp:<EOL><INDENT>return None<EOL><DEDENT>if hsm.version.have_unlock():<EOL><INDENT>if args.stdin:<EOL><INDENT>otp = sys.stdin.readline()<EOL>while otp and otp[-<NUM_LIT:1>] == '<STR_LIT:\n>':<EOL><INDENT>otp = otp[:-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>otp = input('<STR_LIT>')<EOL><DEDENT>if len(otp) == <NUM_LIT>:<EOL><INDENT>return otp<EOL><DEDENT>if otp:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT><DEDENT>return None<EOL>
Get OTP from YubiKey.