Return a JSON-serializable representation.
500323
def to_json(self):
        """"""
        return {
            'network': self.network,
            'state': self.state,
            'nodes': self.node_indices,
            'cut': self.cut,
        }
47569
def to_json(self, skip_nulls=True):
        """"""
        return json.dumps(self.to_dict(skip_nulls=skip_nulls))
1306754
def json_data(self):
        """"""
        return {
            "type": self.type,
            "max_size": self.max_size,
            "full": self.full,
            "role": self.role,
        }
12150
def json(self):
        """"""
        if self.search_results is None:
            return None

        result = []
        for row in self.search_results['rows']:
            obj = {}
            for index in range(0, len(self.search_results['fields'])):
                obj[self.search_results['fields'][index]] = row[index]
            result.append(obj)

        return result
348957
def to_output(self, value):
        """"""
        return json.loads(resolwe_runtime_utils.save(self.name, str(value)))
162943
def serialize(self):
        
        return json.dumps({
            "name": self.name,
            "ip": self.ip,
            "port": self.port
        }, sort_keys=True)
579178
def json_dumps(self, obj):
        """"""
        return json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '))
476749
def _as_json(self, **kwargs) -> str:
        
        return json.dumps(self, default=self._default, **kwargs)
776687
def json(self, data):
        """"""
        if data is not None:
            self._body = json.dumps(data)
            self.add_header('Content-Type', 'application/json')
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)
804049
def json_serial(obj):
    """"""
    if isinstance(obj, datetime):
        serial = obj.isoformat()
        return serial
    raise TypeError("Type not serializable")
758509
def to_json(obj):
    """"""
    i = StringIO.StringIO()
    w = Writer(i, encoding='UTF-8')
    w.write_value(obj)
    return i.getvalue()
1278195
def to_json(self, labels=None):
        """"""
        output = self.to_dict(labels)
        return json.dumps(output, cls=DateTimeEncoder, ensure_ascii=False)
907912
def to_json(self):
        
        data = dict()

        for key, value in self.__dict__.items():
            if value:
                if hasattr(value, 'to_dict'):
                    data[key] = value.to_dict()
                elif isinstance(value, datetime):
                    data[key] = value.strftime('%Y-%m-%d %H:%M:%S')
                else:
                    data[key] = value

        return json.dumps(data)
90789
def json(self):
        """"""
        if self._data_json:
            return self._data_json

        if not self.data or self.content_type != 'application/json':
            return None

        self._data_json = json.loads(self.data)
        return self._data_json
78657
def to_json(self):
    """"""
    new_pos = self._blob_reader.tell()
    if self._has_iterated:
      new_pos -= 1
    return {self.BLOB_KEY_PARAM: self._blob_key,
            self.INITIAL_POSITION_PARAM: new_pos,
            self.END_POSITION_PARAM: self._end_position}
765921
def spl_json(self):
        """"""
        _splj = {}
        _splj["type"] = self._type
        _splj["value"] = self._value
        return _splj