def minimum_part_size(size_in_bytes, default_part_size=DEFAULT_PART_SIZE):
 part_size = _MEGABYTE
 if ((default_part_size * MAXIMUM_NUMBER_OF_PARTS) < size_in_bytes):
  if (size_in_bytes > ((4096 * _MEGABYTE) * 10000)):
   raise ValueError(('File size too large: %s' % size_in_bytes))
  min_part_size = (size_in_bytes / 10000)
  power = 3
  while (part_size < min_part_size):
   part_size = math.ldexp(_MEGABYTE, power)
   power += 1
  part_size = int(part_size)
 else:
  part_size = default_part_size
 return part_size

def minimum_part_size ( size_in_bytes , default_part_size = DEFAULT_PART_SIZE ) : part_size = _MEGABYTE if ( ( default_part_size * MAXIMUM_NUMBER_OF_PARTS ) < size_in_bytes ) : if ( size_in_bytes > ( ( 4096 * _MEGABYTE ) * 10000 ) ) : raise ValueError ( ( 'File size too large: %s' % size_in_bytes ) ) min_part_size = ( size_in_bytes / 10000 ) power = 3 while ( part_size < min_part_size ) : part_size = math . ldexp ( _MEGABYTE , power ) power += 1 part_size = int ( part_size ) else : part_size = default_part_size return part_size
calculate the minimum part size needed for a multipart upload .