def nti(s):
 if (s[0] != chr(128)):
  try:
   n = int((nts(s) or '0'), 8)
  except ValueError:
   raise HeaderError('invalid header')
 else:
  n = 0L
  for i in xrange((len(s) - 1)):
   n <<= 8
   n += ord(s[(i + 1)])
 return n

def nti ( s ) : if ( s [ 0 ] != chr ( 128 ) ) : try : n = int ( ( nts ( s ) or '0' ) , 8 ) except ValueError : raise HeaderError ( 'invalid header' ) else : n = 0 L for i in xrange ( ( len ( s ) - 1 ) ) : n <<= 8 n += ord ( s [ ( i + 1 ) ] ) return n
convert a number field to a python number .