def encode_pair(name, value):
 nameLength = len(name)
 if (nameLength < 128):
  s = chr(nameLength)
 else:
  s = struct.pack('!L', (nameLength | 2147483648L))
 valueLength = len(value)
 if (valueLength < 128):
  s += chr(valueLength)
 else:
  s += struct.pack('!L', (valueLength | 2147483648L))
 return ((s + name) + value)

def encode_pair ( name , value ) : nameLength = len ( name ) if ( nameLength < 128 ) : s = chr ( nameLength ) else : s = struct . pack ( '!L' , ( nameLength | 2147483648 L ) ) valueLength = len ( value ) if ( valueLength < 128 ) : s += chr ( valueLength ) else : s += struct . pack ( '!L' , ( valueLength | 2147483648 L ) ) return ( ( s + name ) + value )
encodes a name/value pair .