def config_auto_int_value(value, default):
 if ((value is None) or (isinstance(value, six.string_types) and (value.lower() == 'auto'))):
  return default
 try:
  value = int(value)
 except (TypeError, ValueError):
  raise ValueError(('Config option must be an integer or the string "auto", not "%s".' % value))
 return value

def config_auto_int_value ( value , default ) : if ( ( value is None ) or ( isinstance ( value , six . string_types ) and ( value . lower ( ) == 'auto' ) ) ) : return default try : value = int ( value ) except ( TypeError , ValueError ) : raise ValueError ( ( 'Config option must be an integer or the string "auto", not "%s".' % value ) ) return value
returns default if value is none or auto .