Check if address is a valid NEO address
979919
def isValidPublicAddress(address: str) -> bool:
    """"""
    valid = False

    if len(address) == 34 and address[0] == 'A':
        try:
            base58.b58decode_check(address.encode())
            valid = True
        except ValueError:
            # checksum mismatch
            valid = False

    return valid
25519
def is_normalized_address(value: Any) -> bool:
    
    if not is_address(value):
        return False
    else:
        return value == to_normalized_address(value)
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);
    }
870620
def CheckAddressState(self, script_hash):
        
        for key, contract in self._contracts.items():
            if contract.ScriptHash.ToBytes() == script_hash.ToBytes():
                return AddressState.InWallet
        for watch in self._watch_only:
            if watch == script_hash:
                return AddressState.InWallet | AddressState.WatchOnly
        return AddressState.NoState
1240679
public static boolean isValidEmail(Object value) {

	InternetAddress addr = parseEmail(value, null);

	if (addr != null) {

	    String address = addr.getAddress();

	    if (address.contains("..")) return false;

	    int pos = address.indexOf('@');

	    if (pos < 1 || pos == address.length() - 1) return false;

	    String local = address.substring(0, pos);
	    String domain = address.substring(pos + 1);

	    if (domain.charAt(0) == '.' || local.charAt(0) == '.' || local.charAt(local.length() - 1) == '.') return false;

	    pos = domain.lastIndexOf('.');

	    if (pos > 0 && pos < domain.length() - 2) { // test TLD to be at
							// least 2 chars all
							// alpha characters
		if (StringUtil.isAllAlpha(domain.substring(pos + 1))) return true;
		try {
		    addr.validate();
		    return true;
		}
		catch (AddressException e) {}
	    }
	}

	return false;
    }
1353123
public boolean isMatch(String address)
  {
    try {
      return isMatch(InetAddress.getByName(address));
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);

      return false;
    }
  }
172491
def is_same_address(left: AnyAddress, right: AnyAddress) -> bool:
    
    if not is_address(left) or not is_address(right):
        raise ValueError("Both values must be valid addresses")
    else:
        return to_normalized_address(left) == to_normalized_address(right)
316852
def valid(self):
        
        two_legged = self.client_email and self.private_key
        three_legged = self.client_id and self.client_secret
        return two_legged or three_legged or False
1273238
function checkNetworks(networks) {
    var result = true;
    var check = null;
    networks.forEach(function (network) {
        // Null
        if (network == null) {
            result = false;
            return;
        }
        // Have nothing to compre to yet
        if (check == null) {
            check = network;
            return;
        }
        // Matches!
        if (check.name === network.name &&
            check.chainId === network.chainId &&
            ((check.ensAddress === network.ensAddress) ||
                (check.ensAddress == null && network.ensAddress == null))) {
            return;
        }
        errors.throwError('provider mismatch', errors.INVALID_ARGUMENT, { arg: 'networks', value: networks });
    });
    return result;
}
185865
public boolean isValidInet6Address(String inet6Address) {
        boolean containsCompressedZeroes = inet6Address.contains("::");
        if (containsCompressedZeroes && (inet6Address.indexOf("::") != inet6Address.lastIndexOf("::"))) {
            return false;
        }
        if ((inet6Address.startsWith(":") && !inet6Address.startsWith("::"))
                || (inet6Address.endsWith(":") && !inet6Address.endsWith("::"))) {
            return false;
        }
        String[] octets = inet6Address.split(":");
        if (containsCompressedZeroes) {
            List<String> octetList = new ArrayList<>(Arrays.asList(octets));
            if (inet6Address.endsWith("::")) {
                // String.split() drops ending empty segments
                octetList.add("");
            } else if (inet6Address.startsWith("::") && !octetList.isEmpty()) {
                octetList.remove(0);
            }
            octets = octetList.toArray(new String[0]);
        }
        if (octets.length > IPV6_MAX_HEX_GROUPS) {
            return false;
        }
        int validOctets = 0;
        int emptyOctets = 0; // consecutive empty chunks
        for (int index = 0; index < octets.length; index++) {
            String octet = octets[index];
            if (octet.length() == 0) {
                emptyOctets++;
                if (emptyOctets > 1) {
                    return false;
                }
            } else {
                emptyOctets = 0;
                // Is last chunk an IPv4 address?
                if (index == octets.length - 1 && octet.contains(".")) {
                    if (!isValidInet4Address(octet)) {
                        return false;
                    }
                    validOctets += 2;
                    continue;
                }
                if (octet.length() > IPV6_MAX_HEX_DIGITS_PER_GROUP) {
                    return false;
                }
                int octetInt = 0;
                try {
                    octetInt = Integer.parseInt(octet, BASE_16);
                } catch (NumberFormatException e) {
                    return false;
                }
                if (octetInt < 0 || octetInt > MAX_UNSIGNED_SHORT) {
                    return false;
                }
            }
            validOctets++;
        }
        if (validOctets > IPV6_MAX_HEX_GROUPS || (validOctets < IPV6_MAX_HEX_GROUPS && !containsCompressedZeroes)) {
            return false;
        }
        return true;
    }
1076297
private static boolean isValidAddress(InetAddress address) {
        if (address == null || address.isLoopbackAddress()) {
            return false;
        }
        String name = address.getHostAddress();
        return (name != null
            && !isAnyHost(name)
            && !isLocalHost(name)
            && isIPv4Host(name));
    }
791157
public boolean isPermittedAddress(String addr) {
        if (addr == null || addr.isEmpty()) {
            return false;
        }

        for (DomainMatcher permAddr : permittedAddressesEnabled) {
            if (permAddr.matches(addr)) {
                return true;
            }
        }
        return false;
    }
906757
def _validate(self, all_valid_addresses):
    """"""
    for dependency, dependents in iteritems(self._dependent_address_map):
      if dependency not in all_valid_addresses:
        raise AddressLookupError(
            'Dependent graph construction failed: {} did not exist. Was depended on by:\n  {}'.format(
             dependency.spec,
             '\n  '.join(d.spec for d in dependents)
          )
        )
492635
def in6_isvalid(address):
    """"""

    try:
        socket.inet_pton(socket.AF_INET6, address)
        return True
    except Exception:
        return False
1198352
def check_addr_status(hsh)
      full_addr = hsh[:full_addr]
      full_addr_f = hsh[:full_addr_f]
      status = nil

      if full_addr && full_addr_f
        status = full_addr != full_addr_f ? 'formatted' : 'unchanged'
      end

      hsh[:address_status] = status
      hsh
    end
786700
public static boolean isValidIPAddress(String networkAddress) {
		if (networkAddress != null) {
			String[] split = networkAddress.split("\\.");
			if (split.length == 4) {
				int[] octets = new int[4];
				for (int i=0; i<4; i++) {
					try {
						octets[i] = Integer.parseInt(split[i]);
					} catch (NumberFormatException e) {
						return false;
					}
					if (octets[i] < 0 || octets[i] > 255) {
						return false;
					}
				}
				return true;
			}
		}
		return false;
	}
203817
public static boolean isValid(final String value) {
        if (value == null) {
            return true;
        }
        if (value.length() == 0) {
            return false;
        }
        try {
            InternetAddress.parse(value, false);
            return true;
        } catch (final AddressException ex) {
            return false;
        }
    }