@classmethod<EOL><INDENT>def _ip_int_from_string(cls, ip_str):<DEDENT>
if not ip_str:<EOL><INDENT>raise AddressValueError('<STR_LIT>')<EOL><DEDENT>octets = ip_str.split('<STR_LIT:.>')<EOL>if len(octets) != <NUM_LIT:4>:<EOL><INDENT>raise AddressValueError("<STR_LIT>" % ip_str)<EOL><DEDENT>try:<EOL><INDENT>return _compat_int_from_byte_vals(<EOL>map(cls._parse_octet, octets), '<STR_LIT>')<EOL><DEDENT>except ValueError as exc:<EOL><INDENT>raise AddressValueError("<STR_LIT>" % (exc, ip_str))<EOL><DEDENT>
Turn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.