A JSON serializable dict representation of self.
608
def as_dict(self):
        
        return {"@module": self.__class__.__module__,
                "@class": self.__class__.__name__,
                "operation": self.operation, "title": self.title,
                "xc": self.xc.as_dict(), "basis_set": self.basis_set.as_dict(),
                "units": self.units.as_dict(), "scf": self.scf.as_dict(),
                "geo": self.geo.as_dict(),
                "others": [k.as_dict() for k in self.other_directives]}
366908
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'code') and self.code is not None:
            _dict['code'] = self.code
        if hasattr(self, 'description') and self.description is not None:
            _dict['description'] = self.description
        if hasattr(self, 'error_id') and self.error_id is not None:
            _dict['error_id'] = self.error_id
        return _dict
760196
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'input') and self.input is not None:
            _dict['input'] = self.input._to_dict()
        if hasattr(self, 'intents') and self.intents is not None:
            _dict['intents'] = [x._to_dict() for x in self.intents]
        if hasattr(self, 'entities') and self.entities is not None:
            _dict['entities'] = [x._to_dict() for x in self.entities]
        return _dict
1221139
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'values') and self.values is not None:
            _dict['values'] = [x._to_dict() for x in self.values]
        if hasattr(self, 'pagination') and self.pagination is not None:
            _dict['pagination'] = self.pagination._to_dict()
        return _dict
197404
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'fields') and self.fields is not None:
            _dict['fields'] = [x._to_dict() for x in self.fields]
        return _dict
560447
def to_dict(self):
        """"""
        return {value.label: value.value for value in self.__values if not value.unset}
414830
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'intent') and self.intent is not None:
            _dict['intent'] = self.intent
        if hasattr(self, 'confidence') and self.confidence is not None:
            _dict['confidence'] = self.confidence
        return _dict
1118114
def serializable_dict(d):
    
    newd = {}
    for k in d.keys():
        if isinstance(d[k], type({})):
            newd[k] = serializable_dict(d[k])
            continue
        try:
            json.dumps({'k': d[k]})
            newd[k] = d[k]
        except:
            pass  # unserializable
    return newd
521302
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'types') and self.types is not None:
            _dict['types'] = [x._to_dict() for x in self.types]
        if hasattr(self, 'categories') and self.categories is not None:
            _dict['categories'] = [x._to_dict() for x in self.categories]
        return _dict
1079176
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'match') and self.match is not None:
            _dict['match'] = self.match
        return _dict
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
417448
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'text') and self.text is not None:
            _dict['text'] = self.text
        if hasattr(self, 'type') and self.type is not None:
            _dict['type'] = self.type
        if hasattr(self, 'evidence') and self.evidence is not None:
            _dict['evidence'] = [x._to_dict() for x in self.evidence]
        return _dict
1184362
def dict(self):
        """"""
        return {
            'raw': self.raw,
            'start_index': self.start_index,
            'end_index': self.end_index,
            'stripped': self.stripped,
            'noun_phrases': self.noun_phrases,
            'polarity': self.polarity,
            'subjectivity': self.subjectivity,
        }
828103
def dict(self):
        
        return {k: getattr(self, k) for k in self.__class__.defaults}
1536
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'overwrite') and self.overwrite is not None:
            _dict['overwrite'] = self.overwrite
        return _dict
1027490
def to_dict(self):
        """"""
        if self.operator == '$eq':
            return {self.q: self.value}
        if self.q is None:
            return {self.operator: self.value}
        return {self.q: {self.operator: self.value}}
884712
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'type') and self.type is not None:
            _dict['type'] = self.type
        if hasattr(self, 'text') and self.text is not None:
            _dict['text'] = self.text
        return _dict