#NEWLINE# def getMP( data , count = 1 ) : #NEWLINE# #INDENT# '\n    Get multiple precision integer out of the string.  A multiple precision\n    integer is stored as a 4-byte length followed by length bytes of the\n    integer.  If count is specified, get count integers out of the string.\n    The return value is a tuple of count integers followed by the rest of\n    the data.\n    ' #NEWLINE# mp = [ ] #NEWLINE# c = 0 #NEWLINE# for i in range ( count ) : #NEWLINE# #INDENT# ( length , ) = struct . unpack ( '>L' , data [ c : ( c + 4 ) ] ) #NEWLINE# mp . append ( int_from_bytes ( data [ ( c + 4 ) : ( ( c + 4 ) + length ) ] , 'big' ) ) #NEWLINE# c += ( 4 + length ) #NEWLINE# #UNINDENT# return ( tuple ( data ) + ( data [ c : ] , ) )