def decode(txt):
 _nid = NameID()
 for part in txt.split(','):
  if (part.find('=') != (-1)):
   (i, val) = part.split('=')
   try:
    setattr(_nid, ATTR[int(i)], unquote(val))
   except:
    pass
 return _nid

def decode ( txt ) : _nid = NameID ( ) for part in txt . split ( ',' ) : if ( part . find ( '=' ) != ( - 1 ) ) : ( i , val ) = part . split ( '=' ) try : setattr ( _nid , ATTR [ int ( i ) ] , unquote ( val ) ) except : pass return _nid
decode a file .