def register_msgpack():
 pack = unpack = None
 try:
  import msgpack
  if (msgpack.version >= (0, 4)):
   from msgpack import packb, unpackb
   def pack(s):
    return packb(s, use_bin_type=True)
   def unpack(s):
    return unpackb(s, encoding=u'utf-8')
  else:
   def version_mismatch(*args, **kwargs):
    raise SerializerNotInstalled(u'msgpack requires msgpack-python >= 0.4.0')
   pack = unpack = version_mismatch
 except (ImportError, ValueError):
  def not_available(*args, **kwargs):
   raise SerializerNotInstalled(u'No decoder installed for msgpack. Please install the msgpack-python library')
  pack = unpack = not_available
 registry.register(u'msgpack', pack, unpack, content_type=u'application/x-msgpack', content_encoding=u'binary')

def register_msgpack ( ) : pack = unpack = None try : import msgpack if ( msgpack . version >= ( 0 , 4 ) ) : from msgpack import packb , unpackb def pack ( s ) : return packb ( s , use_bin_type = True ) def unpack ( s ) : return unpackb ( s , encoding = u'utf-8' ) else : def version_mismatch ( * args , ** kwargs ) : raise SerializerNotInstalled ( u'msgpack requires msgpack-python >= 0.4.0' ) pack = unpack = version_mismatch except ( ImportError , ValueError ) : def not_available ( * args , ** kwargs ) : raise SerializerNotInstalled ( u'No decoder installed for msgpack. Please install the msgpack-python library' ) pack = unpack = not_available registry . register ( u'msgpack' , pack , unpack , content_type = u'application/x-msgpack' , content_encoding = u'binary' )
register msgpack serializer .