code: def __init__(self, directory, num_buckets):
      self.bucket_files = [
          os.path.join(directory, f"ngrams_{i}.bkt.txt")
          for i in range(num_buckets)
      ]
      self.buckets = list(map(TextArchive, self.bucket_files))
      self.checkpoint_file = os.path.join(
          directory, f"bucket_offsets.ckpt"
      )
  
      if os.path.exists(self.checkpoint_file):
          self.bucket_offsets = pickle.load(
              open(self.checkpoint_file, "rb")
          )
      else:
          self.bucket_offsets = [0 for i in range(len(self.buckets))]
  
      for i, offset in enumerate(self.bucket_offsets):
          bucket = self.buckets[i]
          bucket.fh.seek(offset)
          bucket.fh.truncate()
  
imports: import argparse
  import json
  import pickle
  import os
  import sys
  from pathlib import Path
  import glob
  import signal
  from signal import SIGINT
  from tqdm import tqdm
  from lm_eval.decontamination.janitor import Janitor, word_ngrams
  from lm_eval.decontamination.archiver import TextArchive, Reader
  import logging
  from tqdm_multiprocess.logger import setup_logger_tqdm
label_desc: Use image node_id 1 to create a new Buckets object  with example: obj = Buckets(directory, num_buckets)