def to_int(s, default=<NUM_LIT:0>):
try:<EOL><INDENT>return int(s)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>return default<EOL><DEDENT>
Return input converted into an integer. If failed, then return ``default``.

Examples::

    >>> to_int('1')
    1
    >>> to_int(1)
    1
    >>> to_int('')
    0
    >>> to_int(None)
    0
    >>> to_int(0, default='Empty')
    0
    >>> to_int(None, default='Empty')
    'Empty'