Returns the JSON representation of this graph.
550728
def to_json(self):
        '''  '''
        roots = []
        for r in self.roots:
            roots.append(r.to_json())
        return {'roots': roots}
586964
def to_json(self):
        """"""

        j = {}
        for p in self.properties:
            j[p] = getattr(self, p)

        return json.dumps(j)
1223100
def to_json(self):
        

        result = {
            'name': self.name,
            'id': self._real_id(),
            'type': self.type,
            'localized': self.localized,
            'omitted': self.omitted,
            'required': self.required,
            'disabled': self.disabled,
            'validations': [v.to_json() for v in self.validations]
        }

        if self.type == 'Array':
            result['items'] = self.items

        if self.type == 'Link':
            result['linkType'] = self.link_type

        return result
864397
def to_json(self):
        ''' 
        '''

        skip_list = []
        for u, v, connection_type in self.skip_connections:
            skip_list.append({"from": u, "to": v, "type": connection_type})
        return {"node_list": self.layers, "skip_list": skip_list}
453638
def json_data(self):
        """"""
        return {
            "vector_id": self.vector_id,
            "origin_id": self.origin_id,
            "destination_id": self.destination_id,
            "info_id": self.info_id,
            "network_id": self.network_id,
            "receive_time": self.receive_time,
            "status": self.status,
        }
192619
def json(self):
        
        nodes = []
        links = []

        for link in self.link_set.all():
            if self.is_layer2:
                source = link.interface_a.mac
                destination = link.interface_b.mac
            else:
                source = str(link.interface_a.ip_set.first().address)
                destination = str(link.interface_b.ip_set.first().address)
            nodes.append({
                'id': source
            })
            nodes.append({
                'id': destination
            })
            links.append(OrderedDict((
                ('source', source),
                ('target', destination),
                ('cost', link.metric_value)
            )))

        return OrderedDict((
            ('type', 'NetworkGraph'),
            ('protocol', self.parser.protocol),
            ('version', self.parser.version),
            ('metric', self.parser.metric),
            ('nodes', nodes),
            ('links', links)
        ))
954446
def to_jsons(graph: BELGraph, **kwargs) -> str:
    """"""
    graph_json_str = to_json(graph)
    return json.dumps(graph_json_str, ensure_ascii=False, **kwargs)
830676
def to_json(self):
        
        points = [point.to_json() for point in self.points]
        return {
            'points': points,
            'transportationModes': self.transportation_modes,
            'locationFrom': self.location_from.to_json() if self.location_from != None else None,
            'locationTo': self.location_to.to_json() if self.location_to != None else None
        }
1373524
def to_JSON(self):
        
        return json.dumps({"station_ID": self._station_ID,
                            "interval": self._interval,
                            "reception_time": self._reception_time,
                            "measurements": self._measurements
                           })
26190
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("type",type.getName());

        if (targetConfig != null) {
            ret.put("target", targetConfig.toJSON());
        }
        if (pathParts != null) {
            try {
                ret.put("path",getPath());
            } catch (UnsupportedOperationException exp) {
                // Happens when request doesnt support paths
            }
        }
        return ret;
    }
355831
def to_json(self) -> dict:
        ''''''

        d = self.__dict__
        d['p2th_wif'] = self.p2th_wif
        return d
113309
def to_json(self):
        """"""
        return {
            'wind_speed': self.wind_speed,
            'wind_direction': self.wind_direction,
            'rain': self.rain,
            'snow_on_ground': self.snow_on_ground
        }
548419
public JSONObject toJSON() throws JSONException {
        JSONObject json = new JSONObject();

        json.put(JSON_TYPE, this.getType());

        return json;
    }
127638
def ToJson(self):
        
        obj = {
            'usage': self.Usage,
            'data': '' if not self.Data else self.Data.hex()
        }
        return obj
982414
def json_data(self):
        """"""
        return {
            "type": self.type,
            "origin_id": self.origin_id,
            "network_id": self.network_id,
            "contents": self.contents,
        }
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)
1101782
def to_json(self):
        """"""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }