def decode_unicode(input):
 if isinstance(input, dict):
  temp = {}
  for (key, value) in sorted(six.iteritems(input)):
   temp[decode_unicode(key)] = decode_unicode(value)
  return temp
 elif isinstance(input, (tuple, list)):
  return [decode_unicode(element) for element in input]
 elif isinstance(input, six.text_type):
  return input.encode('utf-8')
 elif (six.PY3 and isinstance(input, six.binary_type)):
  return input.decode('utf-8')
 else:
  return input

def decode_unicode ( input ) : if isinstance ( input , dict ) : temp = { } for ( key , value ) in sorted ( six . iteritems ( input ) ) : temp [ decode_unicode ( key ) ] = decode_unicode ( value ) return temp elif isinstance ( input , ( tuple , list ) ) : return [ decode_unicode ( element ) for element in input ] elif isinstance ( input , six . text_type ) : return input . encode ( 'utf-8' ) elif ( six . PY3 and isinstance ( input , six . binary_type ) ) : return input . decode ( 'utf-8' ) else : return input
decode the unicode of the message .