Write this :class:`SampleSheet` to JSON.

        Returns:
            str: The JSON dump of all entries in this sample sheet.
329955
def to_json(self, **kwargs: Mapping) -> str:
        
        content = {
            'Header': dict(self.Header),
            'Reads': self.Reads,
            'Settings': dict(self.Settings),
            'Data': [sample.to_json() for sample in self.samples],
            **{title: dict(getattr(self, title)) for title in self._sections},
        }
        return json.dumps(content, **kwargs)
1167067
def export_as_json(self):
        
        result = {
            "subscription": self.subscription,
        }

        if self.name:
            result["name"] = self.name

        if self.ask is not None:
            result["ask"] = self.ask

        if self.approved:
            result["approved"] = self.approved

        if self.groups:
            result["groups"] = sorted(self.groups)

        return result
921697
def json(self):
        

        data = {
            "segment_name": self.segment_name,
            "formula": self.formula,
            "warnings": [w.json() for w in self.warnings],
            "model_params": self.model_params,
        }
        return data
230191
def save_to_json(self):
        """"""
        requestvalues = {
            'Dataset': self.dataset,
            'Header' : self._get_item_array(self.header),
            'Filter' : self._get_item_array(self.filter),
            'Stub' : self._get_item_array(self.stub),
            'Frequencies': self.frequencies
        }
        return json.dumps(requestvalues)
91339
def json_data(self, instance, default=None):
        
        value = self.get(instance)
        if value:
            return value.output
        return value
512827
def to_json(self):
        

        result = super(ContentType, self).to_json()
        result.update({
            'name': self.name,
            'description': self.description,
            'displayField': self.display_field,
            'fields': [f.to_json() for f in self.fields]
        })
        return result
803533
def to_json_basic(self):
        
        return {'name': self.__class__.__name__, 'priority': self.priority,
                'address': self.address, 'rtr': self.rtr}
1218924
def _dump(self):
        
        return {
            "topic": self.topic,
            "headers": self._headers,
            "id": self.id,
            "body": self.body,
            "queue": self.queue,
        }
576604
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.to_schema(), *args, **kwargs)
1003085
def serialize(self) -> dict:
        
        data = {**self}
        if "attachments" in self:
            data["attachments"] = json.dumps(self["attachments"])
        return data
436996
def json(self):
        
        return {
            "model_type": self.model_type,
            "formula": self.formula,
            "status": self.status,
            "model_params": self.model_params,
            "r_squared_adj": _noneify(self.r_squared_adj),
            "warnings": [w.json() for w in self.warnings],
        }
162943
def serialize(self):
        
        return json.dumps({
            "name": self.name,
            "ip": self.ip,
            "port": self.port
        }, sort_keys=True)
417235
def json(self):
        
        json_string = json.dumps(
            self.scores,
            indent=2,
            allow_nan=True
        )
        return json_string
520141
def json(self):
        
        insndescs = [{insndesc['instruction']: insndesc['value']} for insndesc in self.structure]
        return json.dumps(insndescs)
937656
def serialize(self):
        
        return {
            "uuid": self.uuid, "type": self.type, "instance_id": self.instance_id,
            "prepared": self.prepared, "creation_time": self.creation_time,
            "data": self.data
        }
472678
def write_json(self, **kwargs):
        
        self.stdout.write(json.dumps(kwargs) + "\n")
        self.stdout.flush()
1342220
def to_json_str(self):
    
    _json = self.to_json()
    try:
      return json.dumps(_json, sort_keys=True, cls=JsonEncoder)
    except:
      logging.exception("Could not serialize JSON: %r", _json)
      raise