def decode_signed_varint(i):
 if (not (i & 1)):
  return (i >> 1)
 return ((i >> 1) ^ (~ 0))

def decode_signed_varint ( i ) : if ( not ( i & 1 ) ) : return ( i >> 1 ) return ( ( i >> 1 ) ^ ( ~ 0 ) )
zig-zag decodes an integer value .