Returns the :class:`dict` representation of a server object.

    The returned :class:`dict` is meant to be consumed by
    :class:`~bang.deployers.cloud.ServerDeployer` objects.
439463
def server_to_dict(server):
    
    return {
            A.server.ID: server.id,
            A.server.PUBLIC_IPS: [server.public_dns_name],
            A.server.PRIVATE_IPS: [server.private_dns_name],
            }
957778
def to_dict(self, dict_cls=FrozenOrderedDict):
        # type: (Type[dict]) -> Dict[str, Any]
        
        pairs = tuple((k, serialize_object(getattr(self, k), dict_cls))
                      for k in self.call_types)
        if self.typeid:
            d = dict_cls((("typeid", self.typeid),) + pairs)
        else:
            d = dict_cls(pairs)
        return d
167776
def as_dict(self):
        
        drepr = {}
        drepr["name"] = self.name
        drepr["time"] = self.time
        # error pre-serialisation
        drepr["errors"] = [str(err) for err in self.errors]
        # warning  pre-serialisation
        drepr["warnings"] = [str(warn) for warn in self.warnings]
        return drepr
142071
def to_dict(self):
        
        obj_dict = super(PlainText, self).to_dict()
        child_dict = {
            'type': self.__class__.__name__,
            'text': self.text
        }
        obj_dict.update(child_dict)
        return obj_dict
1198330
def to_dict(self):
        
        cache_info = None
        if self.cache_info:
            cache_info = self.cache_info.to_dict()
        return {
            'cache_info': cache_info,
            'html': self.html,
            'scraped': self.scraped,
            'raw': self.raw
        }
637068
def _to_dict(self):
        
        if self.all_:
            return {"all": True}

        return {
            "keys": self.keys,
            "ranges": [keyrange._to_dict() for keyrange in self.ranges],
        }
1341457
def get_as_datadict(self):
        
        return dict(type=self.__class__.__name__, tags=list(self.tags))
710912
def to_dict(self) -> dict:
        
        return {
            key: getattr(self, key)
            for key in self.__slots__
            if getattr(self, key) is not None
        }
925156
def to_dict(self):
        
        def _json_safe(v):
            if isinstance(v, np.ndarray):
                return v.tolist()
            elif is_unit(v)[0]:
                return v.to_string()
            else:
                return v
        d = {k:_json_safe(v) for k,v in self._descriptors.items()}
        d['nparray'] = self.__class__.__name__.lower()
        return d
997009
def to_dict(self):
        
        return {
            'name': self.name,
            'broker': self.broker.to_dict(),
            'pid': self.pid,
            'process_pids': self.process_pids,
            'concurrency': self.concurrency,
            'job_count': self.job_count,
            'queues': [q.to_dict() for q in self.queues]
        }
335816
def to_dict(self):
        
        result_dict = {}
        for column in self.__table__.columns.keys():  # pylint: disable=no-member
            value = result_dict[column] = getattr(self, column, None)
            if isinstance(value, Decimal):
                result_dict[column] = float(result_dict[column])
            elif isinstance(value, datetime.datetime):
                result_dict[column] = value.isoformat()
        return result_dict
1093799
def to_dict(self):
        
        return dict(
            variants=self.variants,
            distinct=self.distinct,
            sort_key=self.sort_key,
            sources=self.sources,
            source_to_metadata_dict=self.source_to_metadata_dict)
900606
def to_dict(self):
        
        out_dict = dict(self)
        for k, v in out_dict.items():
            if v is self:
                out_dict[k] = out_dict
            elif hasattr(v, 'to_dict'):
                out_dict[k] = v.to_dict()
            elif hasattr(v, 'to_list'):
                out_dict[k] = v.to_list()
        return out_dict
590765
def to_dict(self):
        
        return {k: getattr(self, k) for k in filter(
            lambda k: not k.startswith('_') and k != 'to_dict', dir(self))}
1093182
def to_dict(self):
        
        return {
            "id": self.get_node_id().hex,
            "name": self.title,
            "thumbnail": self.thumbnail.filename if self.thumbnail else None,
            "language" : self.language,
            "description": self.description or "",
            "license": self.license,
            "source_domain": self.source_domain,
            "source_id": self.source_id,
            "ricecooker_version": __version__,
        }
721158
def get_servers(self):
        
        json_scheme = self.gen_def_json_scheme('GetServers')
        json_obj = self.call_method_post(method='GetServers', json_scheme=json_scheme)
        self.json_servers = json_obj
        # if this method is called I assume that i must re-read the data
        # so i reinitialize the vmlist
        self.vmlist = VMList()
        # getting all instanced IP in case the list is empty
        if len(self.iplist) <= 0:
            self.get_ip()
        for elem in dict(json_obj)["Value"]:
            if elem['HypervisorType'] is 4:
                s = Smart(interface=self, sid=elem['ServerId'])
            else:
                s = Pro(interface=self, sid=elem['ServerId'])
            s.vm_name = elem['Name']
            s.cpu_qty = elem['CPUQuantity']
            s.ram_qty = elem['RAMQuantity']
            s.status = elem['ServerStatus']
            s.datacenter_id = elem['DatacenterId']
            s.wcf_baseurl = self.wcf_baseurl
            s.auth = self.auth
            s.hd_qty = elem['HDQuantity']
            s.hd_total_size = elem['HDTotalSize']
            if elem['HypervisorType'] is 4:
                ssd = self.get_server_detail(elem['ServerId'])
                try:
                    s.ip_addr = str(ssd['EasyCloudIPAddress']['Value'])
                except TypeError:
                    s.ip_addr = 'Not retrieved.'
            else:
                s.ip_addr = []
                for ip in self.iplist:
                    if ip.serverid == s.sid:
                        s.ip_addr.append(ip)
            self.vmlist.append(s)
        return True if json_obj['Success'] is True else False
1151948
def to_dict(self):
        
        obj = {
            'id' : self.identifier,
            'name' : self.name,
            'description' : self.description,
            'type' : self.data_type.to_dict()
        }
        if not self.default is None:
            obj['default'] = self.default
        return obj