def unicode_obj(obj):
 if isinstance(obj, dict):
  return unicode_dict(obj)
 elif isinstance(obj, (list, tuple)):
  return unicode_list(obj)
 elif isinstance(obj, six.string_types):
  return unicode_string(obj)
 elif isinstance(obj, (int, float)):
  return obj
 elif (obj is None):
  return obj
 else:
  try:
   return text(obj)
  except:
   return text(repr(obj))

def unicode_obj ( obj ) : if isinstance ( obj , dict ) : return unicode_dict ( obj ) elif isinstance ( obj , ( list , tuple ) ) : return unicode_list ( obj ) elif isinstance ( obj , six . string_types ) : return unicode_string ( obj ) elif isinstance ( obj , ( int , float ) ) : return obj elif ( obj is None ) : return obj else : try : return text ( obj ) except : return text ( repr ( obj ) )
make sure keys and values of dict/list/tuple is unicode .