def deflate_long(n, add_sign_padding=True):
 s = bytes()
 n = long(n)
 while ((n != 0) and (n != (-1))):
  s = (struct.pack('>I', (n & xffffffff)) + s)
  n >>= 32
 for i in enumerate(s):
  if ((n == 0) and (i[1] != deflate_zero)):
   break
  if ((n == (-1)) and (i[1] != deflate_ff)):
   break
 else:
  i = (0,)
  if (n == 0):
   s = zero_byte
  else:
   s = max_byte
 s = s[i[0]:]
 if add_sign_padding:
  if ((n == 0) and (byte_ord(s[0]) >= 128)):
   s = (zero_byte + s)
  if ((n == (-1)) and (byte_ord(s[0]) < 128)):
   s = (max_byte + s)
 return s

def deflate_long ( n , add_sign_padding = True ) : s = bytes ( ) n = long ( n ) while ( ( n != 0 ) and ( n != ( - 1 ) ) ) : s = ( struct . pack ( '>I' , ( n & xffffffff ) ) + s ) n >>= 32 for i in enumerate ( s ) : if ( ( n == 0 ) and ( i [ 1 ] != deflate_zero ) ) : break if ( ( n == ( - 1 ) ) and ( i [ 1 ] != deflate_ff ) ) : break else : i = ( 0 , ) if ( n == 0 ) : s = zero_byte else : s = max_byte s = s [ i [ 0 ] : ] if add_sign_padding : if ( ( n == 0 ) and ( byte_ord ( s [ 0 ] ) >= 128 ) ) : s = ( zero_byte + s ) if ( ( n == ( - 1 ) ) and ( byte_ord ( s [ 0 ] ) < 128 ) ) : s = ( max_byte + s ) return s
turns a long-int into a normalized byte string .