def _is_hostmask(self, ip_str):
bits = ip_str.split('<STR_LIT:.>')<EOL>try:<EOL><INDENT>parts = [x for x in map(int, bits) if x in self._valid_mask_octets]<EOL><DEDENT>except ValueError:<EOL><INDENT>return False<EOL><DEDENT>if len(parts) != len(bits):<EOL><INDENT>return False<EOL><DEDENT>if parts[<NUM_LIT:0>] < parts[-<NUM_LIT:1>]:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Test if the IP string is a hostmask (rather than a netmask).

        Args:
            ip_str: A string, the potential hostmask.

        Returns:
            A boolean, True if the IP string is a hostmask.