@LocalContext
def unpack_many(data, word_size=None):
 word_size = (word_size or context.word_size)
 endianness = context.endianness
 sign = context.sign
 if (word_size == 'all'):
  return [unpack(data, word_size)]
 if ((word_size % 8) != 0):
  raise ValueError('unpack_many(): word_size must be a multiple of 8')
 out = []
 n = (word_size // 8)
 for i in range(0, len(data), n):
  out.append(unpack(data[i:(i + n)], word_size))
 return list(map(int, out))

@ LocalContext def unpack_many ( data , word_size = None ) : word_size = ( word_size or context . word_size ) endianness = context . endianness sign = context . sign if ( word_size == 'all' ) : return [ unpack ( data , word_size ) ] if ( ( word_size % 8 ) != 0 ) : raise ValueError ( 'unpack_many(): word_size must be a multiple of 8' ) out = [ ] n = ( word_size // 8 ) for i in range ( 0 , len ( data ) , n ) : out . append ( unpack ( data [ i : ( i + n ) ] , word_size ) ) return list ( map ( int , out ) )
unpack -> int list splits data into groups of word_size//8 bytes and calls :func:unpack on each group .