def isIPAddress(addr):
    """
    Determine whether the given string represents an IPv4 address.

    @type addr: C{str}
    @param addr: A string which may or may not be the decimal dotted
    representation of an IPv4 address.

    @rtype: C{bool}
    @return: C{True} if C{addr} represents an IPv4 address, C{False}
    otherwise.
    """
    dottedParts = addr.split('.')
    if len(dottedParts) == 4:
        for octet in dottedParts:
            try:
                value = int(octet)
            except __HOLE__:
                return False
            else:
                if value < 0 or value > 255:
                    return False
        return True
    return False
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/internet/abstract.py/isIPAddress