shows JSON indented representation of d
331116
def pretty_dict_str(d, indent=2):
    """"""
    b = StringIO()
    write_pretty_dict_str(b, d, indent=indent)
    return b.getvalue()
264006
def as_text(self, is_proof=True, is_pretty=False):
        
        data = self.as_dictionary(is_proof)
        if is_pretty:
            return json.dumps(data, indent=2, separators=(',', ': '))

        return json.dumps(data)
850938
def to_json(self, lev=0, indent=None):
        
        if lev:
            return self.to_dict(lev + 1)
        else:
            return json.dumps(self.to_dict(1), indent=indent)
263267
def pretty_params(data, indent=2):
    
    data_to_print = _series_data_filter(data)
    print(json.dumps(data_to_print, indent=indent))
238520
def markdown_dict_string(d):
    
    # sort experimental data from simulated data
    from collections import OrderedDict
    types = OrderedDict()
    for key, value in sorted(d.items()):
        if 'type' in value:
            if value['type'] not in types:
                types[value['type']] = []
            types[value['type']].append(key)
        else:
            print(key, 'does not define data type!')
    # format output
    s = ''
    for type in ['scRNAseq', 'scqPCR', 'bulk', 'simulated']:
        s += '\nExamples using ' + type + ' data.\n'
        for key in types[type]:
            value = d[key]
            s += '* [' + key + '](#' + key + ')'
            if 'ref' in value:
                if 'doi' in value:
                    link = 'http://dx.doi.org/' + value['doi']
                elif 'url' in value:
                    link = value['url']
                s += (' - [' +  value['ref'].replace('et al.','*et al.*')
                             + '](' + link +  ')')
            if 'title' in value:
                s += '   \n*' + value['title'] + '*'
            s += '\n'
    return s
1224863
void toJSONString(final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
            final boolean includeNullValuedFields, final int depth, final int indentWidth,
            final StringBuilder buf) {
        final boolean prettyPrint = indentWidth > 0;
        final int n = items.size();
        int numDisplayedFields;
        if (includeNullValuedFields) {
            numDisplayedFields = n;
        } else {
            numDisplayedFields = 0;
            for (final Entry<String, Object> item : items) {
                if (item.getValue() != null) {
                    numDisplayedFields++;
                }
            }
        }
        if (objectId == null && numDisplayedFields == 0) {
            buf.append("{}");
        } else {
            buf.append(prettyPrint ? "{\n" : "{");
            if (objectId != null) {
                // id will be non-null if this object does not have an @Id field, but was referenced by
                // another object (need to include ID_TAG)
                if (prettyPrint) {
                    JSONUtils.indent(depth + 1, indentWidth, buf);
                }
                buf.append('"');
                buf.append(JSONUtils.ID_KEY);
                buf.append(prettyPrint ? "\": " : "\":");
                JSONSerializer.jsonValToJSONString(objectId, jsonReferenceToId, includeNullValuedFields, depth + 1,
                        indentWidth, buf);
                if (numDisplayedFields > 0) {
                    buf.append(',');
                }
                if (prettyPrint) {
                    buf.append('\n');
                }
            }
            for (int i = 0, j = 0; i < n; i++) {
                final Entry<String, Object> item = items.get(i);
                final Object val = item.getValue();
                if (val != null || includeNullValuedFields) {
                    final String key = item.getKey();
                    if (key == null) {
                        // Keys must be quoted, so the unquoted null value cannot be a key
                        // (Should not happen -- JSONParser.parseJSONObject checks for null keys)
                        throw new IllegalArgumentException("Cannot serialize JSON object with null key");
                    }
                    if (prettyPrint) {
                        JSONUtils.indent(depth + 1, indentWidth, buf);
                    }
                    buf.append('"');
                    JSONUtils.escapeJSONString(key, buf);
                    buf.append(prettyPrint ? "\": " : "\":");
                    JSONSerializer.jsonValToJSONString(val, jsonReferenceToId, includeNullValuedFields, depth + 1,
                            indentWidth, buf);
                    if (++j < numDisplayedFields) {
                        buf.append(',');
                    }
                    if (prettyPrint) {
                        buf.append('\n');
                    }
                }
            }
            if (prettyPrint) {
                JSONUtils.indent(depth, indentWidth, buf);
            }
            buf.append('}');
        }
    }
1128296
def view(self):
        
        print(self.format(remove='bnode',
                          sort=True,
                          pretty=True,
                          compress=True,
                          output='json',
                          add_ids=True))
51722
def prettyPrintDictionary(d):
    ''''''
    maxKeyLength = 0
    maxValueLength = 0
    for key, value in d.iteritems():
        maxKeyLength = max(maxKeyLength, len(key))
        maxValueLength = max(maxValueLength, len(key))
    for key in sorted(d.keys()):
        print ("%"+str(maxKeyLength)+"s : %-" + str(maxValueLength)+ "s") % (key,d[key])
200406
function renderDefinitionRhs(val, indent) {
  indent = indent || 0;
  const indentStr = Array(indent + 1).join(' ');

  if (isUndefined(val)) {
    throw new Error('Undefined value in definition RHS.');
  }
  if (isBoolean(val)) {
    return val.toString();
  }
  if (isInteger(val)) {
    return val;
  }
  if (isString(val)) {
    return JSON.stringify(val);
  }
  if (isArray(val)) {
    return ['[', map(val, (elem) => `${indentStr}  ${JSON.stringify(elem)}`).join(',\n'), `${indentStr}]`].join('\n');
  }
  if (isObject(val)) {
    const rhsLines = exports.renderDefinition(val, indent + 2);
    const rhsStr = rhsLines;
    return `{
${rhsStr}
${indentStr}}`;
  }
}
261718
def _to_key(d):
        """"""
        as_str = json.dumps(d, sort_keys=True)
        return as_str.replace('"{{', '{{').replace('}}"', '}}')
900273
def as_text(self, is_pretty=False):
        """"""
        values = {'id': self._id, 'type': self._type}
        if self._owner:
            values['owner'] = self._owner

        if is_pretty:
            return json.dumps(values, indent=4, separators=(',', ': '))

        return json.dumps(values)
771921
def dump_json(data, indent=None):
    
    return json.dumps(data,
                      indent=indent,
                      ensure_ascii=False,
                      sort_keys=True,
                      separators=(',', ': '))
803020
function () {
            var indentStr = '';
            for (var i = 0; i < indentLevel; i++) {
                indentStr += INDENT;
            }
            return {
                type: 'WhiteSpace',
                value: indentStr
            };
        }
983101
def to_json(self, indent=2):
        
        return json.dumps(self, default=json_encode_for_printing, indent=indent)
990913
function getDataFromDotNotation (d, row) {
  return d.split('.').reduce((o, i) => { if (o === undefined) { return undefined } else { return o[i] } }, row)
}
925800
def to_json_string(self, indent=None):
        ''' 

        '''
        root_ids = []
        for r in self._roots:
            root_ids.append(r.id)

        root_references = self._all_models.values()

        json = {
            'title' : self.title,
            'roots' : {
                'root_ids' : root_ids,
                'references' : references_json(root_references)
            },
            'version' : __version__
        }

        return serialize_json(json, indent=indent)
203165
function renderInlines(val, indent) {
  const indentStr = Array(indent + 1).join(' ');
  return '\n' + map(orderBy(val, first), (pair) =>
    [
      `${indentStr}${pair[0]} {
${exports.renderDefinition(pair[1], indent + 2)}
${indentStr}}`,
    ].join('\n')
  ).join('\n\n');
}