Returns the port manager.

        :returns: Port manager
170456
def port_manager(self):
        
        if self._port_manager is None:
            self._port_manager = PortManager.instance()
        return self._port_manager
1367242
def get_unassigned_ports(self):
        
        uri = "{}/unassignedPortsForPortMonitor".format(self.data["uri"])
        response = self._helper.do_get(uri)

        return self._helper.get_members(response)
348868
def port(self, name):
        
        for p in self.ports:
            if p.name == name:
                return p
604063
def local_bind_ports(self):
        
        self._check_is_started()
        return [_server.local_port for _server in self._server_list if
                _server.local_port is not None]
1001390
def ports(self):
        

        if self._ports is None:
            self._ports = {}
            if self.net_settings["Ports"]:
                for key, value in self.net_settings["Ports"].items():
                    cleaned_port = key.split("/")[0]
                    self._ports[cleaned_port] = graceful_chain_get(value, 0, "HostPort")
            # in case of --net=host, there's nothing in network settings, let's get it from "Config"
            exposed_ports_section = graceful_chain_get(self.inspect_data, "Config", "ExposedPorts")
            if exposed_ports_section:
                for key, value in exposed_ports_section.items():
                    cleaned_port = key.split("/")[0]
                    self._ports[cleaned_port] = None  # extremely docker specific
        return self._ports
166166
def get_physical_port(self):
        """"""
        obj = None
        if self.is_link_aggregation():
            obj = UnityLinkAggregation.get(self._cli, self.get_id())
        else:
            obj = UnityEthernetPort.get(self._cli, self.get_id())
        return obj
47044
def get_ports(device_owners=None, vnic_type=None, port_id=None, active=True):
    """"""
    session = db.get_reader_session()
    with session.begin():
        port_model = models_v2.Port
        ports = (session
                 .query(port_model)
                 .filter_unnecessary_ports(device_owners, vnic_type, active))
        if port_id:
            ports = ports.filter(port_model.id == port_id)
    return ports.all()
236735
def get_default_config_help(self):
        
        config = super(RiemannHandler, self).get_default_config_help()

        config.update({
            'host': '',
            'port': '',
            'transport': 'tcp or udp',
        })

        return config
201174
def get_available_host_port():
    
    # Only import adb module if needed.
    from mobly.controllers.android_device_lib import adb
    for _ in range(MAX_PORT_ALLOCATION_RETRY):
        port = portpicker.PickUnusedPort()
        # Make sure adb is not using this port so we don't accidentally
        # interrupt ongoing runs by trying to bind to the port.
        if port not in adb.list_occupied_adb_ports():
            return port
    raise Error('Failed to find available port after {} retries'.format(
        MAX_PORT_ALLOCATION_RETRY))
621401
def get_port(self, for_protocol):
        '''
            
        '''
        assert len(for_protocol) == 1, "expect single letter code"

        use_ssl = for_protocol in ('s', 'g')

        if 'port' in self: return self['hostname'], int(self['port']), use_ssl

        rv = next(i for i in self['ports'] if i[0] == for_protocol)

        port = None
        if len(rv) >= 2:
            try:
                port = int(rv[1:])
            except:
                pass
        port = port or DEFAULT_PORTS[for_protocol]

        return self['hostname'], port, use_ssl
1343755
def all_ports(self):
        
        from mbuild.port import Port
        return [successor for successor in self.successors()
                if isinstance(successor, Port)]
1062337
def ports(self) -> dict:
        """"""
        return {
            param: self[param].raw
            for param in self
            if param.startswith(IOPORT)
        }
1141577
def todict(self):
        '''
        
        '''
        return {
            'Source port': self.srcport,
            'Destination port': self.destport,
            'Protocol': self.protocol,
            'Destination address': self.destaddr}
1119923
def getConf(cls, settings, options):
        ""
        ports = ['http_port', 'https_port', 'cache_port']
        for port_name in ports:
            port = getattr(settings, port_name.upper(), None)
            # only use the settings ports if the defaults were left unchanged
            default = getattr(defaults, port_name.upper())
            if port and options.get(port_name) == default:
                options[port_name] = port

        _opts = [
            ('key', 'hx_private_key'),
            ('cert', 'hx_certficate'),
            ('wsgi', 'wsgi_application')
        ]
        for opt_name, settings_name in _opts:
            opt = getattr(settings, settings_name.upper(), None)
            if opt:
                options[opt_name] = opt

        if not options['settings']:
            options['settings'] = environ['DJANGO_SETTINGS_MODULE']
        return options
865384
function getPort(port_) {
  var port = port_ || process.env.PORT || require('minimist')(process.argv.slice(2)).port || 3000;
  return +port;
}
694692
def portMappings() 
            joinThread()
            i, r = 0, 0
            mappings = Array.new
            while r == 0 
                rhost = getCString()
                enabled = getCString()
                duration = getCString()
                description = getCString()
                nport = getCString()
                lport = getCString()
                duration = getCString()
                client = getCString()
                protocol = getCString()

                r = MiniUPnP.UPNP_GetGenericPortMappingEntry(@urls.controlURL,
                                  @data.servicetype,i.to_s,nport,client,lport,
                                  protocol,description,enabled,rhost,duration)
                if r != 0 then
                    break;
                end
                i = i+1
                mappings << PortMapping.new(client.rstrip,lport.rstrip.to_i,
                                  nport.rstrip.to_i,protocol.rstrip,
                                  description.rstrip,enabled.rstrip,
                                  rhost.rstrip,duration.rstrip)
            end 
            return  mappings
        end
209930
def ports(self):
        
        # We do here some lazy loading.
        if not self._ports:
            family = self.get_property('adapter-family')
            try:
                port_type = self.port_type_by_family[family]
            except KeyError:
                port_type = None
            self._ports = PortManager(self, port_type)
        return self._ports