code: def test_can_binarize_file_chunk(self):
      # test without multiprocess logic
      with TemporaryDirectory() as dirname:
          raw_file = os.path.join(dirname, "raw1")
          prefix = os.path.join(dirname, "test1")
          impl = "mmap"
  
          data = make_data(out_file=raw_file)
          vocab = build_vocab(data)
  
          binarizer = VocabularyDatasetBinarizer(
              vocab,
              append_eos=False,
          )
  
          summary = FileBinarizer._binarize_chunk_and_finalize(
              binarizer,
              raw_file,
              offset_start=0,
              offset_end=-1,
              output_prefix=prefix,
              dataset_impl=impl,
              vocab_size=len(vocab),
          )
  
          self.compare_ds_data(summary, data, prefix, impl, vocab)
  
file_path: fairseq/tests/test_binarizer.py
imports: import os
  import typing
  import unittest
  from tempfile import TemporaryDirectory
  from fairseq.binarizer import BinarizeSummary, FileBinarizer, VocabularyDatasetBinarizer
  from fairseq.data import Dictionary, indexed_dataset
  from tests.utils import make_data, sizes
label_desc: Use image node_id 3 for calling the TestBinarizer obj's underlying member method code with example usage: obj.test_can_binarize_file_chunk() without return types