Convert a term callback into the proper json. This method is used for the initial graph creation.
762622
function _roots2json(doc){

	var root_id = doc['annotation_class'];
	console.log("_roots2json: " +
		    doc + ', ' +
		    root_id + ', ' +
		    entity_counts[root_id]);

	// Extract the intersting graphs.
	var topo_graph_field = 'topology_graph_json';
	var trans_graph_field = 'regulates_transitivity_graph_json';
	var topo_graph = new model.graph();
	topo_graph.load_base_json(JSON.parse(doc[topo_graph_field]));
	var trans_graph = new model.graph();
	trans_graph.load_base_json(JSON.parse(doc[trans_graph_field]));

	//
	var kids_p = false;
	var kids = [];
	us.each(topo_graph.get_child_nodes(root_id), function(kid){
	    kids.push({
		'id': kid.id(),
		'text': kid.label() || kid.id()
	    });
	});
	if( kids.length > 0 ){
	    kids_p = true;
	}

	// Using the badge template, get the spans for the IDs.
	var ac_badges = new CountBadges(filter_manager);
	var id_to_badge_text =
		ac_badges.make_badge(root_id, entity_counts[root_id]);
	var lbl_txt = doc['annotation_class_label'] || root_id;
	    
	var tmpl = {
	    'id': root_id,
	    'icon': 'glyphicon glyphicon-record',
	    'text': lbl_txt + id_to_badge_text,
	    //'icon': "string",
	    'state': {
		'opened': false,
		'disabled': false,
		'selected': false
	    },
	    'children': kids_p,
	    'li_attr': {},
	    'a_attr': {}
	};

	return tmpl;
    }
1154228
def field_pk_to_json(self, model, pk):
        """"""
        app_label = model._meta.app_label
        model_name = model._meta.model_name
        return {
            'app': app_label,
            'model': model_name,
            'pk': pk,
        }
439401
def to_JSON(self):
        
        return json.dumps({"interval": self._interval,
                           "reception_time": self._reception_time,
                           "Location": json.loads(self._location.to_JSON()),
                           "weathers": json.loads("[" + \
                                ",".join([w.to_JSON() for w in self]) + "]")
                           })
361817
def to_json_path(graph: BELGraph, path: str, **kwargs) -> None:
    """"""
    with open(os.path.expanduser(path), 'w') as f:
        to_json_file(graph, file=f, **kwargs)
1225704
def to_json(self, extras=None):
        
        extras = extras or {}
        to_dict = model_to_dict(self)
        to_dict.update(extras)
        return json.dumps(to_dict, cls=sel.serializers.JsonEncoder)
746386
def from_json(graph_json_dict: Mapping[str, Any], check_version=True) -> BELGraph:
    """"""
    graph = node_link_graph(graph_json_dict)
    return ensure_version(graph, check_version=check_version)
338363
def ToJson(self):
        
        parameters = self.ParameterList.hex()
        paramlist = [ToName(ContractParameterType.FromString(parameters[i:i + 2]).value) for i in range(0, len(parameters), 2)]
        return {
            'hash': self.ScriptHash().To0xString(),
            'script': self.Script.hex(),
            'parameters': paramlist,
            'returntype': ToName(self.ReturnType) if type(self.ReturnType) is int else ToName(int(self.ReturnType))
        }
1206877
def to_json(self):
        
        data = json.dumps(self)

        out = u'{"%s":%s}' % (self.schema['title'], data)
        return out
14929
function convertToJson(callback) {
    var output = new File(file);
    output.contents = new Buffer(JSON.stringify(spritesheet, null, '\t'));
    output.path = file;
    this.push(output);
    callback();
  }
566875
def graphql_queries_to_json(*queries):
    
    rtn = {}
    for i, query in enumerate(queries):
        rtn["q{}".format(i)] = query.value
    return json.dumps(rtn)
1101782
def to_json(self):
        """"""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }
411465
def to_json(*a)
      { :item => if item then
                   item.name
                 else
                   nil
                 end,
        :tag  => if tag then
                   tag.name
                 else
                   nil
                 end,
        :src  => path_from_catalog_root }.to_json(*a)
    end
833099
def ToJson(self):
        
        name = 'Contract'

        try:
            name = self.Name.decode('utf-8')
        except Exception as e:
            pass

        jsn = {'version': self.StateVersion}

        jsn_code = self.Code.ToJson()

        jsn_contract = {
            'name': name,
            'code_version': self.CodeVersion.decode('utf-8'),
            'author': self.Author.decode('utf-8'),
            'email': self.Email.decode('utf-8'),
            'description': self.Description.decode('utf-8'),
            'properties': {
                'storage': self.HasStorage,
                'dynamic_invoke': self.HasDynamicInvoke,
                'payable': self.Payable
            }
        }

        jsn.update(jsn_code)
        jsn.update(jsn_contract)

        if self._nep_token:
            jsn['token'] = self._nep_token.ToJson()

        return jsn
321683
def to_json(self):
        
        data = dict()
        data['name'] = self.name
        data['language'] = self.language
        data['fancy_name'] = self.fancy_name
        data['scenario'] = self.scenario
        return data
624056
def to_json(self):
    
    cursor = self._get_cursor()
    cursor_object = False
    if cursor and isinstance(cursor, datastore_query.Cursor):
      cursor = cursor.to_websafe_string()
      cursor_object = True
    return {"key_range": self._key_range.to_json(),
            "query_spec": self._query_spec.to_json(),
            "cursor": cursor,
            "cursor_object": cursor_object}
1204078
def to_json(self):
        
        res = dict()
        res['Handle'] = ''
        res['Name'] = self.name
        res['ImageUrl'] = self.url
        res['Description'] = self.desc
        res["EntityOptions"] = self.options
        return res
1347029
def to_json(self):
        
        titles = self.get_titles()
        return json.dumps({
                "uri" : self.subject
                , "urn" : str(self.get_urn())
                , "titles" : [{"language":lang, "label":label} for lang, label in titles]
                , "title_abbreviations" : self.get_abbreviations()

            }, indent=2)