def StringifyJSON(item):
 if isinstance(item, (tuple, list)):
  return [StringifyJSON(x) for x in item]
 elif isinstance(item, dict):
  result = {}
  for (k, v) in item.items():
   result[k] = StringifyJSON(v)
  return result
 elif (type(item) in (int, long, float, bool)):
  return item
 elif (item is None):
  return None
 else:
  return utils.SmartUnicode(item)

def StringifyJSON ( item ) : if isinstance ( item , ( tuple , list ) ) : return [ StringifyJSON ( x ) for x in item ] elif isinstance ( item , dict ) : result = { } for ( k , v ) in item . items ( ) : result [ k ] = StringifyJSON ( v ) return result elif ( type ( item ) in ( int , long , float , bool ) ) : return item elif ( item is None ) : return None else : return utils . SmartUnicode ( item )
recursively convert item to a string .