code: def _consume_file(
      filename: str,
      binarizer: Binarizer,
      consumer: tp.Callable[[torch.IntTensor], None],
      offset_start: int,
      offset_end: int,
  ) -> tp.Dict[str, int]:
      summary = BinarizeSummary()
  
      with Chunker(
          PathManager.get_local_path(filename), offset_start, offset_end
      ) as line_iterator:
          for line in line_iterator:
              consumer(binarizer.binarize_line(line, summary))
  
      return {
          "nseq": summary.num_seq,
          "nunk": summary.num_replaced,
          "ntok": summary.num_tok,
          "replaced": summary.replaced,
      }
  
imports: import logging
  import os
  import typing
  from abc import ABC, abstractmethod
  from collections import Counter
  from dataclasses import dataclass
  from multiprocessing import Pool
  import torch
  from fairseq.data import Dictionary, indexed_dataset
  from fairseq.file_chunker_utils import Chunker, find_offsets
  from fairseq.file_io import PathManager
  from fairseq.tokenizer import tokenize_line
label_desc: Use image node_id 3 for calling the LegacyBinarizer obj's underlying member method code with example usage: obj._consume_file(filename, binarizer, consumer, offset_start, offset_end) and returns: dict