def unpack(source):
 (payload, symtab, radix, count) = _filterargs(source)
 if (count != len(symtab)):
  raise UnpackingError('Malformed p.a.c.k.e.r. symtab.')
 try:
  unbase = Unbaser(radix)
 except TypeError:
  raise UnpackingError('Unknown p.a.c.k.e.r. encoding.')
 def lookup(match):
  'Look up symbols in the synthetic symtab.'
  word = match.group(0)
  return (symtab[unbase(word)] or word)
 source = re.sub('\\b\\w+\\b', lookup, payload)
 return _replacestrings(source)

def unpack ( source ) : ( payload , symtab , radix , count ) = _filterargs ( source ) if ( count != len ( symtab ) ) : raise UnpackingError ( 'Malformed p.a.c.k.e.r. symtab.' ) try : unbase = Unbaser ( radix ) except TypeError : raise UnpackingError ( 'Unknown p.a.c.k.e.r. encoding.' ) def lookup ( match ) : word = match . group ( 0 ) return ( symtab [ unbase ( word ) ] or word ) source = re . sub ( '\\b\\w+\\b' , lookup , payload ) return _replacestrings ( source )
unpack data to tuple of length n .