:return: dictionary {index: object} of all ports.
970612
def ports(self):
        

        if not self.get_objects_by_type('port'):
            self.inventory()
        return {int(p.index.split('/')[1]): p for p in self.get_objects_by_type('port')}
1137478
def devices_dict(self):
        """"""
        json_list = {}
        z = 0
        for x in self._raw[ROOT_START_ACTION]:
            if z != self.index:
                json_list.update(x)
            z = z + 1
        return json_list
635250
def as_a_dict(self):
        
        index_dict = {
            'ddoc': self._ddoc_id,
            'name': self._name,
            'type': self._type,
            'def': self._def
        }

        if self._partitioned:
            index_dict['partitioned'] = True

        return index_dict
1020883
def ports_to_spawn(self):
        
        return (self.config.get(config.HTTP_SERVER, dict()).get(config.PORTS)
                or self.DEFAULT_PORTS)
1141577
def todict(self):
        '''
        
        '''
        return {
            'Source port': self.srcport,
            'Destination port': self.destport,
            'Protocol': self.protocol,
            'Destination address': self.destaddr}
385934
def as_dict(self):
        
        my_info = {}
        if self.platform:
            my_info["model"] = self.platform
        if self.resource_id:
            my_info["sn"] = self.resource_id
        if self.vendor:
            my_info["vendor"] = self.vendor
        if self.provider:
            my_info["provider"] = self.provider
        return my_info
944470
def as_dict(self):
        """"""
        return {config_name: getattr(self, config_name)
                for config_name, _ in self._iter_config_props()}
885944
def to_dict(self):
        ''''''
        d = {'connectorId': self.connector_id,
                'name': self.name,
                'dataType': self.data_type,
                'interfaceType': self.interface_type,
                'dataflowType': self.data_flow_type,
                'sourceDataPort': self.source_data_port.to_dict(),
                'targetDataPort': self.target_data_port.to_dict()}
        if self.visible != True:
            d[RTS_EXT_NS_YAML + 'visible'] = self.visible
        if self.subscription_type:
            d['subscriptionType'] = self.subscription_type
        if self.push_interval:
            d['pushInterval'] = self.push_interval
        if self.comment:
            d[RTS_EXT_NS_YAML + 'comment'] = self.comment
        props = []
        for name in self.properties:
            p = {'name': name}
            if self.properties[name]:
                p['value'] = str(self.properties[name])
            props.append(p)
        if props:
            d[RTS_EXT_NS_YAML + 'properties'] = props
        return d
106167
def db_to_dict(db):
    
    return {
            A.database.HOST: db.hostname,
            A.database.PORT: db.port,
            }
829170
def connection(self):
        
        return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password}
637670
def to_dict(self):
        ''''''
        d = {'connectorId': self.connector_id,
                'name': self.name,
                'sourceServicePort': self.source_service_port.to_dict(),
                'targetServicePort': self.target_service_port.to_dict()}
        if self.visible != True:
            d[RTS_EXT_NS_YAML + 'visible'] = self.visible
        if self.trans_method:
            d['transMethod'] = self.trans_method
        if self.comment:
            d[RTS_EXT_NS_YAML + 'comment'] = self.comment
        props = []
        for name in self.properties:
            p = {'name': name}
            if self.properties[name]:
                p['value'] = str(self.properties[name])
            props.append(p)
        if props:
            d[RTS_EXT_NS_YAML + 'properties'] = props
        return d
1342311
def get_ports(self):
        
        ports = []
        container_ports = self.inspect(refresh=True)["NetworkSettings"]["Ports"]
        if not container_ports:
            return ports
        for p in container_ports:
            # TODO: gracefullness, error handling
            ports.append(p.split("/")[0])
        return ports
1141047
def to_dict(self):
        
        return {
            'hostname': self.hostname,
            'port': self.port,
            'transport': self.transport,
            'virtual_host': self.virtual_host
        }
567208
def data(self):
        
        d = {}
        for name in self.key_names:
            d[name] = self.__dict__.get(name, None)
        return d
785906
def available_ports(self):
        
        from mbuild.port import Port
        return [port for port in self.labels.values()
                if isinstance(port, Port) and not port.used]
20638
def _get_hosts_from_ports(self, ports):
        
        hosts = map(lambda x: 'localhost:%d' % int(x.strip()), ports.split(','))
        return list(set(hosts))
1318090
def get_all(self):
        
        if not self.vars:
            return self.parent
        if not self.parent:
            return self.vars
        return dict(self.parent, **self.vars)