def decode_dict(data):
 rv = {}
 for (key, value) in six.iteritems(data):
  if (isinstance(key, six.text_type) and six.PY2):
   key = key.encode('utf-8')
  if (isinstance(value, six.text_type) and six.PY2):
   value = value.encode('utf-8')
  elif isinstance(value, list):
   value = decode_list(value)
  elif isinstance(value, dict):
   value = decode_dict(value)
  rv[key] = value
 return rv

def decode_dict ( data ) : rv = { } for ( key , value ) in six . iteritems ( data ) : if ( isinstance ( key , six . text_type ) and six . PY2 ) : key = key . encode ( 'utf-8' ) if ( isinstance ( value , six . text_type ) and six . PY2 ) : value = value . encode ( 'utf-8' ) elif isinstance ( value , list ) : value = decode_list ( value ) elif isinstance ( value , dict ) : value = decode_dict ( value ) rv [ key ] = value return rv
json decodes as unicode .