def mapping_decoder(mapping_blocks, decoder=None):
 decoder = (decoder or ModbusTypeDecoder())
 for block in mapping_blocks.itervalues():
  for mapping in block.itervalues():
   mapping['address'] = int(mapping['address'])
   mapping['size'] = int(mapping['size'])
   mapping['type'] = decoder.parse(mapping['type'])

def mapping_decoder ( mapping_blocks , decoder = None ) : decoder = ( decoder or ModbusTypeDecoder ( ) ) for block in mapping_blocks . itervalues ( ) : for mapping in block . itervalues ( ) : mapping [ 'address' ] = int ( mapping [ 'address' ] ) mapping [ 'size' ] = int ( mapping [ 'size' ] ) mapping [ 'type' ] = decoder . parse ( mapping [ 'type' ] )
given the raw mapping blocks .