code: def test_huffman_compresses(self):
      data = make_data()
      builder = make_code_builder(data)
      coder = builder.build_code()
  
      with TemporaryDirectory() as dirname:
          prefix = os.path.join(dirname, "huffman")
          build_dataset(prefix, data, coder)
  
          prefix_mmap = os.path.join(dirname, "mmap")
          mmap_builder = indexed_dataset.make_builder(
              indexed_dataset.data_file_path(prefix_mmap),
              "mmap",
              vocab_size=len(POPULATION),
          )
          dictionary = Dictionary()
          for c in POPULATION:
              dictionary.add_symbol(c)
          dictionary.finalize()
          for sentence in data:
              mmap_builder.add_item(
                  dictionary.encode_line(" ".join(sentence))
              )
          mmap_builder.finalize(
              indexed_dataset.index_file_path(prefix_mmap)
          )
  
          huff_size = os.stat(
              indexed_dataset.data_file_path(prefix)
          ).st_size
          mmap_size = os.stat(
              indexed_dataset.data_file_path(prefix_mmap)
          ).st_size
          self.assertLess(huff_size, mmap_size)
  
imports: import os
  import typing
  import unittest
  from collections import Counter
  from tempfile import NamedTemporaryFile, TemporaryDirectory
  from fairseq.data import Dictionary, indexed_dataset
  from fairseq.data.huffman import HuffmanCodeBuilder, HuffmanCoder, HuffmanMMapIndexedDataset, HuffmanMMapIndexedDatasetBuilder
  from tests.utils import POPULATION, make_data, sizes
label_desc: Use image node_id 2 for calling the TestHuffmanDataset obj's underlying member method code with example usage: obj.test_huffman_compresses() without return types