@classmethod<EOL><INDENT>def _compress_hextets(cls, hextets):<DEDENT>
best_doublecolon_start = -<NUM_LIT:1><EOL>best_doublecolon_len = <NUM_LIT:0><EOL>doublecolon_start = -<NUM_LIT:1><EOL>doublecolon_len = <NUM_LIT:0><EOL>for index, hextet in enumerate(hextets):<EOL><INDENT>if hextet == '<STR_LIT:0>':<EOL><INDENT>doublecolon_len += <NUM_LIT:1><EOL>if doublecolon_start == -<NUM_LIT:1>:<EOL><INDENT>doublecolon_start = index<EOL><DEDENT>if doublecolon_len > best_doublecolon_len:<EOL><INDENT>best_doublecolon_len = doublecolon_len<EOL>best_doublecolon_start = doublecolon_start<EOL><DEDENT><DEDENT>else:<EOL><INDENT>doublecolon_len = <NUM_LIT:0><EOL>doublecolon_start = -<NUM_LIT:1><EOL><DEDENT><DEDENT>if best_doublecolon_len > <NUM_LIT:1>:<EOL><INDENT>best_doublecolon_end = (best_doublecolon_start +<EOL>best_doublecolon_len)<EOL>if best_doublecolon_end == len(hextets):<EOL><INDENT>hextets += ['<STR_LIT>']<EOL><DEDENT>hextets[best_doublecolon_start:best_doublecolon_end] = ['<STR_LIT>']<EOL>if best_doublecolon_start == <NUM_LIT:0>:<EOL><INDENT>hextets = ['<STR_LIT>'] + hextets<EOL><DEDENT><DEDENT>return hextets<EOL>
Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.