Remove an IPv4 address from the host.

        :param str ipv4addr: The IP address to remove
165532
def remove_ipv4addr(self, ipv4addr):
        
        for addr in self.ipv4addrs:
            if ((isinstance(addr, dict) and addr['ipv4addr'] == ipv4addr) or
                (isinstance(addr, HostIPv4) and addr.ipv4addr == ipv4addr)):
                self.ipv4addrs.remove(addr)
                break
1028695
def Delete(self):
		

		public_ip_set = [{'public_ipId': o.id} for o in self.parent.public_ips if o!=self]
		self.parent.public_ips = [o for o in self.parent.public_ips if o!=self]
		return(clc.v2.Requests(clc.v2.API.Call('DELETE','servers/%s/%s/publicIPAddresses/%s' % (self.parent.server.alias,self.parent.server.id,self.id),
											   session=self.session),
		                       alias=self.parent.server.alias,
							   session=self.session))
759540
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/ipv4/%s/', ids)

        return super(ApiIPv4, self).delete(url)
53188
def _random_ipv4_address_from_subnet(self, subnet, network=False):
        
        address = str(
            subnet[self.generator.random.randint(
                0, subnet.num_addresses - 1,
            )],
        )

        if network:
            address += '/' + str(self.generator.random.randint(
                subnet.prefixlen,
                subnet.max_prefixlen,
            ))
            address = str(ip_network(address, strict=False))

        return address
997843
def is_ipv4(ip: str) -> bool:
    
    try:
        socket.inet_aton(ip)
    except socket.error:
        return False
    return True
954346
def _get_ipv4_addrs(self):
        
        addrs = self._get_addrs()
        ipv4addrs = addrs.get(netifaces.AF_INET)
        if not ipv4addrs:
            return {}
        return ipv4addrs[0]
229133
def remove_dhcp_server(self, server):
        
        if not isinstance(server, IDHCPServer):
            raise TypeError("server can only be an instance of type IDHCPServer")
        self._call("removeDHCPServer",
                     in_p=[server])
1212429
def is_ip(address):
    
    try:
        # Test to see if already an IPv4/IPv6 address
        address = netaddr.IPAddress(address)
        return True
    except (netaddr.AddrFormatError, ValueError):
        return False
227167
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/networkv4/%s/', ids)

        return super(ApiNetworkIPv4, self).delete(url)
233853
def _address2long(address):
    
    parsed = ipv4.ip2long(address)
    if parsed is None:
        parsed = ipv6.ip2long(address)
    return parsed
1245433
def ignore_cidr(vm_, ip):
    '''
    
    '''
    if HAS_NETADDR is False:
        log.error('Error: netaddr is not installed')
        return 'Error: netaddr is not installed'

    cidr = config.get_cloud_config_value(
        'ignore_cidr', vm_, __opts__, default='', search_global=False
    )
    if cidr != '' and all_matching_cidrs(ip, [cidr]):
        log.warning('IP "%s" found within "%s"; ignoring it.', ip, cidr)
        return True

    return False
1334508
private boolean isIPV4address(String address) {
        StringTokenizer st = new StringTokenizer(address, ".");
        List<String> nodes = new ArrayList<String>();
        while (st.hasMoreTokens())
            nodes.add(st.nextToken());
        return (nodes.size() == 4);
    }
423460
def ip_v4(self, with_port: bool = False) -> str:
        
        ip = '.'.join(str(self.random.randint(0, 255)) for _ in range(4))

        if with_port:
            ip += ':{}'.format(self.port())

        return ip
261793
def maybe_ip_addr(addr):
    

    if six.PY2 and isinstance(addr, str):
        addr = unicode(addr)  # noqa
    try:
        return ipaddress.ip_address(addr)
    except ValueError:
        pass
    return str(addr)
24742
def _ipv6_host(host):
    

    # httplib doesn't like it when we include brackets in IPv6 addresses
    # Specifically, if we include brackets but also pass the port then
    # httplib crazily doubles up the square brackets on the Host header.
    # Instead, we need to make sure we never pass ``None`` as the port.
    # However, for backward compatibility reasons we can't actually
    # *assert* that.  See http://bugs.python.org/issue28539
    #
    # Also if an IPv6 address literal has a zone identifier, the
    # percent sign might be URIencoded, convert it back into ASCII
    if host.startswith('[') and host.endswith(']'):
        host = host.replace('%25', '%').strip('[]')
    return host
697028
public void remove(Address doomedAddr) throws Exception {
        final ModelNode request = createRequest(REMOVE, doomedAddr);
        final ModelNode response = execute(request);
        if (!isSuccess(response)) {
            throw new FailureException(response, "Failed to remove resource at address [" + doomedAddr + "]");
        }
        return;
    }
10923
private void removeForeignHost(final int hostId) {
        ImmutableCollection<ForeignHost> fhs = m_foreignHosts.get(hostId);
        synchronized (m_mapLock) {
            m_foreignHosts = ImmutableMultimap.<Integer, ForeignHost>builder()
                    .putAll(Multimaps.filterKeys(m_foreignHosts, not(equalTo(hostId))))
                    .build();

            Predicate<Long> hostIdNotEqual = new Predicate<Long>() {
                @Override
                public boolean apply(Long intput) {
                    return CoreUtils.getHostIdFromHSId(intput) != hostId;
                }
            };

            m_fhMapping = ImmutableMap.<Long, ForeignHost>builder()
                    .putAll(Maps.filterKeys(m_fhMapping, hostIdNotEqual))
                    .build();
        }
        assert(Thread.holdsLock(this)); // Make sure m_zombieForeignHosts is protected
        ArrayList<ForeignHost> picoNetworkZombies = m_picoZombieForeignHosts.get(hostId);
        ArrayList<ForeignHost> zookeeperZombies = new ArrayList<>(fhs.size());
        for (ForeignHost fh : fhs) {
            if (picoNetworkZombies != null && picoNetworkZombies.contains(fh)) {
                picoNetworkZombies.remove(fh);
            }
            else {
                zookeeperZombies.add(fh);
            }
            fh.close();
        }
        if (picoNetworkZombies != null && picoNetworkZombies.isEmpty()) {
            m_picoZombieForeignHosts.remove(hostId);
        }
        if (!zookeeperZombies.isEmpty()) {
            m_zkZombieForeignHosts.put(hostId, zookeeperZombies);
        }
    }