def human_readable_to_bytes(value):
 value = value.lower()
 if (value[(-2):] == 'ib'):
  suffix = value[(-3):].lower()
 else:
  suffix = value[(-2):].lower()
 has_size_identifier = ((len(value) >= 2) and (suffix in SIZE_SUFFIX))
 if (not has_size_identifier):
  try:
   return int(value)
  except ValueError:
   raise ValueError(('Invalid size value: %s' % value))
 else:
  multiplier = SIZE_SUFFIX[suffix]
  return (int(value[:(- len(suffix))]) * multiplier)

def human_readable_to_bytes ( value ) : value = value . lower ( ) if ( value [ ( - 2 ) : ] == 'ib' ) : suffix = value [ ( - 3 ) : ] . lower ( ) else : suffix = value [ ( - 2 ) : ] . lower ( ) has_size_identifier = ( ( len ( value ) >= 2 ) and ( suffix in SIZE_SUFFIX ) ) if ( not has_size_identifier ) : try : return int ( value ) except ValueError : raise ValueError ( ( 'Invalid size value: %s' % value ) ) else : multiplier = SIZE_SUFFIX [ suffix ] return ( int ( value [ : ( - len ( suffix ) ) ] ) * multiplier )
converts a human readable size to bytes .