class_docstr: Stores data in temp buckets, restitute it shuffled.
docstr: Initialize Shuffler.
  
  Args:
    dirpath (string): directory in which to store temporary files.
    hash_salt (string or bytes): salt to hash keys.
    disable_shuffling (bool): specify whether to shuffle by hashing the key.
docstr_tok: ["Initialize","Shuffler",".","Args",":","dirpath","(","string",")",":","directory","in","which","to","store","temporary","files",".","hash_salt","(","string","or","bytes",")",":","salt","to","hash","keys",".","disable_shuffling","(","bool",")",":","specify","whether","to","shuffle","by","hashing","the","key","."]
code: def __init__(
      self, dirpath, hash_salt, disable_shuffling: bool = False
  ):
      """Initialize Shuffler.
  
      Args:
        dirpath (string): directory in which to store temporary files.
        hash_salt (string or bytes): salt to hash keys.
        disable_shuffling (bool): specify whether to shuffle by hashing the key.
      """
      grp_name = uuid.uuid4()
      self._hasher = hashing.Hasher(hash_salt)
      self._disable_shuffling = disable_shuffling
      self._buckets: List[_Bucket] = []
      for i in range(BUCKETS_NUMBER):
          bucket_name = "bucket_%s_%03d.tmp" % (grp_name, i)
          path = os.path.join(dirpath, bucket_name)
          self._buckets.append(_Bucket(path))
      self._read_only = False
      self._total_bytes = 0
      # To keep data in memory until enough data has been gathered.
      self._in_memory = True
      self._mem_buffer = []
  
imports: import math
  import os
  import struct
  from typing import Iterator, List, Optional
  import uuid
  from absl import logging
  import six
  from tensorflow_datasets.core import hashing
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 to create a new Shuffler object from inherited base classes: object with example: obj = Shuffler(dirpath, hash_salt, disable_shuffling)