def load_bytes(value, units):
 magnitudes = {'KiB': 1, 'MiB': 2, 'GiB': 3, 'TiB': 4}
 if (units not in magnitudes):
  raise InvalidUnits('{} not a recognized unit'.format(units))
 return int((value * (1024 ** magnitudes[units])))

def load_bytes ( value , units ) : magnitudes = { 'KiB' : 1 , 'MiB' : 2 , 'GiB' : 3 , 'TiB' : 4 } if ( units not in magnitudes ) : raise InvalidUnits ( '{} not a recognized unit' . format ( units ) ) return int ( ( value * ( 1024 ** magnitudes [ units ] ) ) )
load sequence of bytes .