Convert object members to a dictionary that can be parsed as JSON.

        Returns:
             dict:
967649
def ToJson(self):
        
        json = super(AccountState, self).ToJson()
        addr = Crypto.ToAddress(self.ScriptHash)

        json['address'] = addr
        json['script_hash'] = str(self.ScriptHash)
        json['frozen'] = self.IsFrozen
        json['votes'] = [v.hex() for v in self.Votes]

        balances = []
        for key, value in self.Balances.items():
            balances.append({'asset': key.To0xString(), 'value': value.ToString()})

        json['balances'] = balances
        return json
1287153
def to_dict(self):
        
        self_dict = {}
        for key, value in six.iteritems(self.__dict__):
            if self.allowed_params and key in self.allowed_params:
                self_dict[key] = value
        return self_dict
1068460
def to_dict(self):
        ""
        ndict = {}
        for key, val in self.__dict__.items():
            if key[0] == "_":
                ndict[key[1:]] = val
            else:
                ndict[key] = val
        return ndict
917244
def to_json(self):
        
        return {
            'userId': self.user_id,
            'username': self.username,
            'roles': self.roles,
            'authSystem': self.auth_system
        }
1154989
def to_dict(self):
        
        return dict(
            (k, self.__dict__[k]) for k in self.__dict__ if k.find("_") != 0)
1269316
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'status') and self.status is not None:
            _dict['status'] = self.status
        if hasattr(self, 'message') and self.message is not None:
            _dict['message'] = self.message
        return _dict
773969
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'limit') and self.limit is not None:
            _dict['limit'] = self.limit
        return _dict
749188
def to_dict(self):
        
        obj_dict = super(Row, self).to_dict()
        cells_dict = [c.to_dict() for c in self.cells]
        child_dict = {
            'type': self.__class__.__name__,
            'cells': cells_dict
        }
        obj_dict.update(child_dict)
        return child_dict
1153719
def to_dict(self):
        
        with self._lock:
            result = {}
            if self._gpayload:
                result.update(self._gpayload)
            if self._tpayload:
                result.update(getattr(self._tpayload, "context", {}))
            return result
127856
def to_dict(self):
        
        result = {}
        result["type"] = "Configurable"
        result["class"] = get_classname(self)
        result["config"] = {}
        for k in self._config:
            v = self._config[k]
            if isinstance(v, JSONObject):
                result["config"][k] = v.to_dict()
            else:
                result["config"][k] = v
        return result
178981
def _to_dict(objects):
    '''
    
    '''
    try:
        if isinstance(objects, six.string_types):
            objects = salt.utils.json.loads(objects)
    except ValueError as err:
        log.error("Could not parse objects: %s", err)
        raise err

    return objects
1279116
def to_dict(self):
        
        obj_dict = super(Table, self).to_dict()
        rows_dict = [r.to_dict() for r in self.rows]
        child_dict = {
            'type': self.__class__.__name__,
            'caption': self.caption,
            'rows': rows_dict
        }
        obj_dict.update(child_dict)
        return obj_dict
1249761
def to_dict(obj, classkey=None):
    
    if isinstance(obj, dict):
        data = {}
        for (k, v) in obj.items():
            data[k] = to_dict(v, classkey)
        return data
    elif hasattr(obj, "_ast"):
        return to_dict(obj._ast())
    elif hasattr(obj, "__iter__") and not isinstance(obj, str):
        return [to_dict(v, classkey) for v in obj]
    elif hasattr(obj, "__dict__"):
        if six.PY2:
            data = dict([(key, to_dict(value, classkey))
                        for key, value in obj.__dict__.iteritems()
                        if not callable(value) and not key.startswith('_')])
        else:
            data = dict([(key, to_dict(value, classkey))
                        for key, value in obj.__dict__.items()
                        if not callable(value) and not key.startswith('_')])

        if classkey is not None and hasattr(obj, "__class__"):
            data[classkey] = obj.__class__.__name__
        return data
    else:
        return obj
549290
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'element') and self.element is not None:
            _dict['element'] = self.element
        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
10436
def to_dict(obj):
    
    d = _to_json_type(obj)
    if isinstance(d, dict):
        return scrub_dict(d)
    else:
        raise ValueError("The value provided must be an object.")
1197566
def to_dict(self):
        
        output = {}
        for key, value in self.__dict__['p'].iteritems():
            if value is None or isinstance(value, SIMPLE_TYPES):
                output[key] = value
            elif hasattr(value, 'to_dot'):
                output[key] = value.to_dot()
            elif hasattr(value, 'to_dict'):
                output[key] = value.to_dict()
            elif isinstance(value, datetime.date):
                # Convert date/datetime to ms-since-epoch ("new Date()").
                ms = time.mktime(value.utctimetuple()) * 1000
                ms += getattr(value, 'microseconds', 0) / 1000
                output[key] = int(ms)
            elif isinstance(value, dict):
                output[key] = []
            else:
                raise ValueError('cannot encode ' + repr(key))

        return output