#NEWLINE# def do_int( value , default = 0 , base = 10 ) : #NEWLINE# #INDENT# "Convert the value into an integer. If the\n    conversion doesn't work it will return ``0``. You can\n    override this default using the first parameter. You\n    can also override the default base (10) in the second\n    parameter, which handles input with prefixes such as\n    0b, 0o and 0x for bases 2, 8 and 16 respectively.\n    " #NEWLINE# try : #NEWLINE# #INDENT# return int ( value , base ) #NEWLINE# #UNINDENT# except ( TypeError , ValueError ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return int ( float ( default ) ) #NEWLINE# #UNINDENT# except ( TypeError , ValueError ) : #NEWLINE# #INDENT# return default