{
                u'8080/tcp': [
                    {
                        u'host_port': u'8080',
                        u'host_ip': u''
                    }
                ]
            }
544538
def port_bindings(self, value):
        
        if isinstance(value, (list, dict)):
                self._port_bindings = self._convert_port_bindings(value)
        elif value is None:
            self._port_bindings = None
        else:
            raise TypeError('port bindings must be a dict, list, or None. {0} was passed.'.format(type(value)))
1141047
def to_dict(self):
        
        return {
            'hostname': self.hostname,
            'port': self.port,
            'transport': self.transport,
            'virtual_host': self.virtual_host
        }
990368
def split_addrs(addrs):
    '''
    '''
    splitted = {}
    for addr in addrs:
        host, port, _ = _addr_key(addr)
        if host not in splitted:
            splitted[host] = {}
        if port not in splitted[host]:
            splitted[host][port] = []
        splitted[host][port].append(addr)
    return splitted
281110
def hostname_with_port(self):
        ''''''
        default_port = RELATIVE_SCHEME_DEFAULT_PORTS.get(self.scheme)
        if not default_port:
            return ''

        assert '[' not in self.hostname
        assert ']' not in self.hostname

        if self.is_ipv6():
            hostname = '[{}]'.format(self.hostname)
        else:
            hostname = self.hostname

        if default_port != self.port:
            return '{}:{}'.format(hostname, self.port)
        else:
            return hostname
594710
async def read(cls, *, hostnames: typing.Sequence[str] = None):
        
        params = {}
        if hostnames:
            params["hostname"] = [
                normalize_hostname(hostname)
                for hostname in hostnames
            ]
        data = await cls._handler.read(**params)
        return cls(map(cls._object, data))
82818
function(o) {
    o.scheme = '';
    o.hostname = '';
    o._ipv4 = undefined;
    o._ipv6 = undefined;
    o.port = '';
    o.path = '';
    o.query = '';
    o.fragment = '';
    return o;
}
1347828
def host_from_uri(uri):
    
    default_ports = {
        'HTTP': '80',
        'HTTPS': '443',
    }

    sch, netloc, path, par, query, fra = urlparse(uri)
    if ':' in netloc:
        netloc, port = netloc.split(':', 1)
    else:
        port = default_ports.get(sch.upper())

    return netloc, port
715547
def get_host_port_names(self, host_name):
        
        port_names = list()
        host = self.get_hosts_by_name(host_name)
        fc_ports = host.fc_ports
        iscsi_ports = host.iscsi_ports
        port_names.extend(fc_ports.split(',') if fc_ports != '' else [])
        port_names.extend(iscsi_ports.split(',') if iscsi_ports != '' else [])
        return port_names
1239762
def get_ips(host, port):
    
    ips = set()

    for af_type in (socket.AF_INET, socket.AF_INET6):
        try:
            records = socket.getaddrinfo(host, port, af_type, socket.SOCK_STREAM)
            ips.update(rec[4][0] for rec in records)
        except socket.gaierror as ex:
            pass

    return ips
796604
def split_host_and_port(netloc: str) -> Tuple[str, Optional[int]]:
    
    match = re.match(r"^(.+):(\d+)$", netloc)
    if match:
        host = match.group(1)
        port = int(match.group(2))  # type: Optional[int]
    else:
        host = netloc
        port = None
    return (host, port)
189870
private String hostAndPort() {
        int start = url.indexOf("://") + 3;
        int end = url.indexOf("/", start);
        return url.substring(start, end);
    }
302156
def dns():
    '''
    
    '''
    # Provides:
    #   dns
    if salt.utils.platform.is_windows() or 'proxyminion' in __opts__:
        return {}

    resolv = salt.utils.dns.parse_resolv()
    for key in ('nameservers', 'ip4_nameservers', 'ip6_nameservers',
                'sortlist'):
        if key in resolv:
            resolv[key] = [six.text_type(i) for i in resolv[key]]

    return {'dns': resolv} if resolv else {}
468464
def hosts2map (hosts):
    
    hostset = set()
    nets = []
    for host in hosts:
        if _host_cidrmask_re.match(host):
            host, mask = host.split("/")
            mask = int(mask)
            if not is_valid_cidrmask(mask):
                log.error(LOG_CHECK,
                          "CIDR mask %d is not a valid network mask", mask)
                continue
            if not is_valid_ipv4(host):
                log.error(LOG_CHECK, "host %r is not a valid ip address", host)
                continue
            nets.append(dq2net(host, cidr2mask(mask)))
        elif _host_netmask_re.match(host):
            host, mask = host.split("/")
            if not is_valid_ipv4(host):
                log.error(LOG_CHECK, "host %r is not a valid ip address", host)
                continue
            if not is_valid_ipv4(mask):
                log.error(LOG_CHECK,
                          "mask %r is not a valid ip network mask", mask)
                continue
            nets.append(dq2net(host, netmask2mask(mask)))
        elif is_valid_ip(host):
            hostset.add(expand_ip(host)[0])
        else:
            hostset |= set(resolve_host(host))
    return (hostset, nets)
730902
function parsePorts(arg) {
  // coerce and split
  var ports = ('' + arg).split(':');
  if (ports.length !== 2) {
    panic('Error parsing ports.');
  }

  // parse ints
  var devicePort = Number((ports[0] === '') ? NaN : ports[0])
    , relayPort = Number((ports[1] === '') ? NaN : ports[1]);

  // NaN check em
  if (devicePort !== devicePort || relayPort !== relayPort) {
    panic('Error parsing ports.');
  }

  return [devicePort, relayPort];
}
108069
def port_pair(self):
        """"""
        if self.transport is NotSpecified:
            return (self.port, "tcp")
        else:
            return (self.port, self.transport)
403088
def ip_bracket(addr):
    '''
    
    '''
    addr = ipaddress.ip_address(addr)
    return ('[{}]' if addr.version == 6 else '{}').format(addr)
1206342
def list_port_forwarding_rules(ip_address_id=nil, listall=false)
      params = { 'command' => 'listPortForwardingRules' }
      params['ipAddressId'] = ip_address_id if ip_address_id
      params['listall'] = listall
      json = send_request(params)
      json['portforwardingrule']
    end