def decode_password(pw, name):
 decPW = ''
 if (pw and pw.startswith(__PW_PREFIX)):
  for n in range(len(__PW_PREFIX), len(pw), 2):
   try:
    ch = chr(int((pw[n] + pw[(n + 1)]), 16))
   except ValueError:
    logging.error(T('Incorrectly encoded password %s'), name)
    return ''
   decPW += ch
  return decPW
 else:
  return pw

def decode_password ( pw , name ) : decPW = '' if ( pw and pw . startswith ( __PW_PREFIX ) ) : for n in range ( len ( __PW_PREFIX ) , len ( pw ) , 2 ) : try : ch = chr ( int ( ( pw [ n ] + pw [ ( n + 1 ) ] ) , 16 ) ) except ValueError : logging . error ( T ( 'Incorrectly encoded password %s' ) , name ) return '' decPW += ch return decPW else : return pw
decode hexadecimal encoded password but only decode when prefixed .