def make_int(s, default='<STR_LIT>', ignore_commas=True):
if ignore_commas and isinstance(s, basestring):<EOL><INDENT>s = s.replace('<STR_LIT:U+002C>', '<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>return int(s)<EOL><DEDENT>except (IndexError, ValueError, AttributeError, TypeError):<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return int(re.split(str(s), '<STR_LIT>')[<NUM_LIT:0>])<EOL><DEDENT>except ValueError:<EOL><INDENT>try:<EOL><INDENT>return int(float(normalize_scientific_notation(str(s), ignore_commas)))<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>try:<EOL><INDENT>return int(first_digits(s))<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>return default<EOL><DEDENT><DEDENT><DEDENT>
r"""Coerce a string into an integer (long ints will fail)

    TODO:
    - Ignore dashes and other punctuation within a long string of digits,
       like a telephone number, partnumber, datecode or serial number.
    - Use the Decimal type to allow infinite precision
    - Use regexes to be more robust

    >>> make_int('12345')
    12345
    >>> make_int('0000012345000       ')
    12345000
    >>> make_int(' \t\n123,450,00\n')
    12345000