Converts the specified object to a JSON string and returns it.
@param {Object} obj - The object.
@param {Boolean} [prettyPrint=false] - Whether to pretty print the JSON.
@returns {String} The JSON string.
427066
function (obj, prettyPrint) {
    return prettyPrint ? JSON.stringify(obj,
        Object.keys(findUniqueKeys(
            obj, {}, [])).sort(), 4) : JSON.stringify(obj)
  }
92364
function pretty(srcObj) {
      return typeOf(srcObj, 'arr', 'obj') ? JSON.stringify(srcObj, null, 2) : String(srcObj);
    }
79958
def __dumps(*args, **kwargs):
    
    indent = None
    if (current_app.config.get('JSONIFY_PRETTYPRINT_REGULAR', False) and
            not request.is_xhr):
        indent = 2
    return json.dumps(args[0] if len(args) is 1 else dict(*args, **kwargs),
                      indent=indent)
771844
function stringify(obj) {
    var cache = [];

    return JSON.stringify(obj, function (key, value) {
        if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) {
            if (cache.indexOf(value) !== -1) {
                return '[Circular]';
            }
            cache.push(value);
        }
        return value;
    });
}
72538
def write_json(json_obj, filename, mode="w", print_pretty=True):
    '''
    '''
    with open(filename, mode) as filey:
        if print_pretty:
            filey.writelines(
                json.dumps(
                    json_obj,
                    indent=4,
                    separators=(
                        ',',
                        ': ')))
        else:
            filey.writelines(json.dumps(json_obj))
    return filename
1367582
public function toJSON($pretty = false)
    {
        if (!$pretty) {
            return json_encode($this->expose());
        } else {
            return $this->prettyPrint(json_encode($this->expose()));
        }
    }
1022659
@Override
	public String toJson(Object obj) {
		try {
			String json;
			if (obj == null) {
				json = null;
			}
			else {
				json = mapper.writeValueAsString(obj);
			}
			return json;
		}
		catch (Exception e) {
			throw new JsonException(e.getMessage(), e);
		}
	}
1062859
def prettyprint(self):
        """"""
        return json.dumps(self.asJSON(), sort_keys=True, indent=4, separators=(',', ': '))
1196108
function(obj) {
  for (var item in obj) {
    console.log('  ' + item + ': ' + JSON.stringify(obj[item]));
  }
}
384768
def pprint(obj, *args, **kwargs):
    
    if isinstance(obj, collections.OrderedDict):
        print(json.dumps(obj, *args, **kwargs))
    else:
        py_pprint(obj, *args, **kwargs)
881488
def _json_pretty_print(self, content):
        
        temp = json.loads(content)
        return json.dumps(
            temp,
            sort_keys=True,
            indent=4,
            separators=(
                ',',
                ': '))
1080098
def json_formatter(obj):
    
    if isinstance(obj, str):
        # Make a list of size 1
        return json.dumps([obj], indent=True)
    else:
        return json.dumps(obj, indent=True, sort_keys=True)
351260
public static String toJson(Object obj) {
		try {
			return objectMapper.writeValueAsString(obj);
		} catch (JsonProcessingException e) {
			throw new RuntimeException(e);
		}
	}
1003404
def pretty_json(obj):
    
    return json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '), ensure_ascii=False)
1019697
public function objectToString($obj)
    {
        switch (gettype($obj)) {
            case 'boolean':
                return var_export($obj, true);

            case 'NULL':
                return 'null';

            case 'string':
                return '"' . $obj . '"';
        }

        return rtrim(print_r($obj, true));
    }
644664
def pretty(self, obj=None, display=True):
        
        ret = self._format_obj(obj if obj is not None else self.obj)
        if display:
            print(ret)
        else:
            return ret
283267
def pretty_print(self, obj=None):
        
        print(self.pretty(obj if obj is not None else self.obj))