Return a JSON-serializable representation.
162792
def to_json(self):
        """"""
        return {
            'network': self.network,
            'before_state': self.before_state,
            'after_state': self.after_state,
            'cause_indices': self.cause_indices,
            'effect_indices': self.effect_indices,
            'cut': self.cut
        }
226646
def _to_json(self):
        
        return dict(( (k, v) for k, v in self.__dict__.iteritems() if k != 'server'))
593463
def to_serializable_value(self):
        
        return_dict = {}
        for name, field in self.__dict__.items():
            if isinstance(field, fields.Field):
                return_dict[name] = field.to_serializable_value()
        return return_dict
726170
def to_json(self, indent=None, sort_keys=True):
        
        return json.dumps(self.to_dict(), indent=indent, sort_keys=sort_keys)
1254012
def json(self):
        """"""
        if hasattr(self, '_json'):
            return self._json
        try:
            self._json = json.loads(self.text or self.content)
        except ValueError:
            self._json = None
        return self._json
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
1240854
def json(content, request=None, response=None, ensure_ascii=False, **kwargs):
    """"""
    if hasattr(content, 'read'):
        return content

    if isinstance(content, tuple) and getattr(content, '_fields', None):
        content = {field: getattr(content, field) for field in content._fields}
    return json_converter.dumps(content, default=_json_converter, ensure_ascii=ensure_ascii, **kwargs).encode('utf8')
565003
def dumps(obj):
    """"""
    return json.dumps(obj, indent=4, sort_keys=True, cls=CustomEncoder)
1360886
def to_json(self):
        """"""
        return {
            'solar_model': self.solar_model,
            'month': self.month,
            'day_of_month': self.day_of_month,
            'clearness': self.clearness,
            'daylight_savings_indicator': self.daylight_savings_indicator
        }
924130
def json(self, **kwargs):
        '''
        
        '''
        body = self._decompress(self.encoding)
        return _json.loads(body, **kwargs)
500322
def json_serial(obj):
    """"""
    if isinstance(obj, LegipyModel):
        return obj.to_json()
    elif isinstance(obj, (datetime.date, datetime.datetime)):
        return obj.isoformat()
    raise TypeError("Type {0} not serializable".format(repr(type(obj))))
220267
def _serialized(self):
        """"""
        return {'title': self.title,
                'summary': self.summary,
                'areadesc': self.areadesc,
                'event': self.event,
                'samecodes': self.samecodes,
                'zonecodes': self.zonecodes,
                'expiration': self.expiration,
                'updated': self.updated,
                'effective': self.effective,
                'published': self.published,
                'severity': self.severity,
                'category': self.category,
                'urgency': self.urgency,
                'msgtype': self.msgtype,
                'link': self.link,
                }
804049
def json_serial(obj):
    """"""
    if isinstance(obj, datetime):
        serial = obj.isoformat()
        return serial
    raise TypeError("Type not serializable")
1092717
def json_data(self):
        """"""
        return {
            "number": self.number,
            "type": self.type,
            "participant_id": self.participant_id,
            "question": self.question,
            "response": self.response,
        }
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
        }
138889
def to_json(self, pretty=True):
        
        data_dict = self.to_dict()
        if pretty:
            return json.dumps(
                data_dict, sort_keys=True, indent=2)
        return json.dumps(data_dict, sort_keys=True)
47569
def to_json(self, skip_nulls=True):
        """"""
        return json.dumps(self.to_dict(skip_nulls=skip_nulls))