Returns a json-serializable representation.
181980
def to_query(self):
        
        return {
            "geo_shape": {
                self.name: {
                    "indexed_shape":  {
                        "index": self.index_name,
                        "type": self.doc_type,
                        "id": self.shape_id,
                        "path": self.path
                    }
                }
            }
        }
749170
def json_serialize(obj):
    
    if isinstance(obj, datetime):
        return obj.isoformat()

    if hasattr(obj, 'id'):
        return jsonify(obj.id)

    if hasattr(obj, 'name'):
        return jsonify(obj.name)

    raise TypeError('{0} is not JSON serializable'.format(obj))
1371785
def to_JSON(self):
        
        return json.dumps({"reference_time": self._reference_time,
                           "location": json.loads(self._location.to_JSON()),
                           "value": self._value,
                           "reception_time": self._reception_time,
                           })
1300718
def json(self, **kwargs):
        """"""
        encoding = detect_encoding(self.content[:4])
        value = self.content.decode(encoding)

        return simplejson.loads(value, **kwargs)
653670
def json(self):
        """"""
        return {
            "id": self.ID,
            "steps": self.steps,
            "graph_source": self.source,
            "errored": self.errored
        }
229825
public JSONObject toJson() {
        JSONObject ret = new JSONObject();
        JSONArray columns = new JSONArray(Arrays.asList(new String[]{"time"}));
        for (String f : this.columns) {
            columns.put(f);
        }
        ret.put(KEY_COLUMNS, columns);

        JSONArray data = new JSONArray();
        ret.put(KEY_ROWS, data);
        for (Long ts : rows.keySet()) {
            JSONArray row = new JSONArray();
            row.put(ts);
            Map<String, Object> temp = rows.get(ts);
            for (String f : this.columns) {
                Object val = temp.get(f);
                row.put(val != null ? val : JSONObject.NULL);
            }
            data.put(row);
        }

        return ret;
    }
390920
def serialize(self, obj):
        """"""
        if hasattr(obj, '_jsid'):
            return {'immutable': False, 'value': obj._jsid}
        else:
            obj_json = {'immutable': True}
            try:
                json.dumps(obj)
                obj_json['value'] = obj
            except:
                pass
            if callable(obj):
                guid = str(uuid.uuid4())
                callback_registry[guid] = obj
                obj_json['callback'] = guid
            return obj_json
1315836
def to_json(self, *, include_keys=None, exclude_keys=None, use_default_excludes=True,
              pretty=False):
    
    return to_json(
      self.to_dict(
        include_keys=include_keys,
        exclude_keys=exclude_keys,
        use_default_excludes=use_default_excludes),
      pretty=pretty)
1263048
def serialize(self):
        
        return json.dumps({
            "port": self.port,
            "ip": self.ip,
            "host": self.host,
            "peer": self.peer.serialize() if self.peer else None,
            "metadata": json.dumps(self.metadata or {}, sort_keys=True),
        }, sort_keys=True)
367532
def to_json(self):
        

        result = super(Snapshot, self).to_json()
        result.update({
            'snapshot': self.snapshot.to_json(),
        })
        return result
254014
def to_json(self, *args, **kwargs):
    '''
    '''
    try:
      import ujson as json
    except ImportError:
      import json
    return json.dumps(self.serialized, *args, **kwargs)
173407
def json_data(self):
        """"""
        return {
            "info_in_id": self.info_in_id,
            "info_out_id": self.info_out_id,
            "node_id": self.node_id,
            "network_id": self.network_id,
        }
924189
def toJson(self, data=None, pretty=False):
        """"""
        if data==None: data = self.attrs
        data = self.flatten(data) # don't send objects as str in json
        #if pretty:
        ret = json.dumps(data, indent=4, sort_keys=True)
        #self.inflate() # restore objects from json str data
        return ret
359605
def to_json(self):
        """"""
        return {
            'header': self.header.to_json(),
            'values': self._values,
            'datetimes': self.datetimes,
            'validated_a_period': self._validated_a_period
        }
104685
def to_json(data):
    """"""
    return json.dumps(data, default=lambda x: x.__dict__, sort_keys=True, indent=4)
790342
def save_to_json(self):
        """"""

        requestvalues = {
            'id': self.dataset,
            'publicationDate': self.publication_date.strftime('%Y-%m-%d'),
            'source': self.source,
            'refUrl': self.refernce_url,
        }        
        return json.dumps(requestvalues)
1286225
public String toJson() {
        Map<String, Object> data = toMap();
        return SerializationUtils.toJsonString(data);
    }