def _size_map(size):
 try:
  if (not isinstance(size, int)):
   if re.search('[Kk]', size):
    size = (1024 * float(re.sub('[Kk]', '', size)))
   elif re.search('[Mm]', size):
    size = ((1024 ** 2) * float(re.sub('[Mm]', '', size)))
   size = int(size)
  return size
 except:
  return None

def _size_map ( size ) : try : if ( not isinstance ( size , int ) ) : if re . search ( '[Kk]' , size ) : size = ( 1024 * float ( re . sub ( '[Kk]' , '' , size ) ) ) elif re . search ( '[Mm]' , size ) : size = ( ( 1024 ** 2 ) * float ( re . sub ( '[Mm]' , '' , size ) ) ) size = int ( size ) return size except : return None
map bcaches size strings to real bytes .