def nti(s):
<EOL>if s[<NUM_LIT:0>] != chr(<NUM_LIT>):<EOL><INDENT>try:<EOL><INDENT>n = int(nts(s, "<STR_LIT:ascii>", "<STR_LIT:strict>") or "<STR_LIT:0>", <NUM_LIT:8>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise InvalidHeaderError("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>n = <NUM_LIT:0><EOL>for i in range(len(s) - <NUM_LIT:1>):<EOL><INDENT>n <<= <NUM_LIT:8><EOL>n += ord(s[i + <NUM_LIT:1>])<EOL><DEDENT><DEDENT>return n<EOL>
Convert a number field to a python number.