class_docstr: Actor wrapping around a packing job.
  
  This actor is used for chunking the packed data into smaller chunks that
  can be transferred via the object store more efficiently.
  
  The actor will start packing the directory when initialized, and separate
  chunks can be received by calling the remote ``next()`` task.
  
  Args:
      source_dir: Path to local directory to pack into tarfile.
      exclude: Pattern of files to exclude, e.g.
          ``["*/checkpoint_*]`` to exclude trial checkpoints.
      files_stats: Dict of relative filenames mapping to a tuple of
          (mtime, filesize). Only files that differ from these stats
          will be packed.
      chunk_size_bytes: Cut bytes stream into chunks of this size in bytes.
      max_size_bytes: If packed data exceeds this value, raise an error before
          transfer. If ``None``, no limit is enforced.
class_docstr_tok: ["Actor","wrapping","around","a","packing","job",".","This","actor","is","used","for","chunking","the","packed","data","into","smaller","chunks","that","can","be","transferred","via","the","object","store","more","efficiently",".","The","actor","will","start","packing","the","directory","when","initialized",",","and","separate","chunks","can","be","received","by","calling","the","remote","``","next","(",")","``","task",".","Args",":","source_dir",":","Path","to","local","directory","to","pack","into","tarfile",".","exclude",":","Pattern","of","files","to","exclude",",","e.g",".","``","[","``","*","\/checkpoint_","*","]","``","to","exclude","trial","checkpoints",".","files_stats",":","Dict","of","relative","filenames","mapping","to","a","tuple","of","(","mtime",",","filesize",")",".","Only","files","that","differ","from","these","stats","will","be","packed",".","chunk_size_bytes",":","Cut","bytes","stream","into","chunks","of","this","size","in","bytes",".","max_size_bytes",":","If","packed","data","exceeds","this","value",",","raise","an","error","before","transfer",".","If","``","None","``",",","no","limit","is","enforced","."]
code: def next(self) -> Optional[bytes]:
      if not self.iter:
          self.iter = iter(self._chunk_generator())
      try:
          return next(self.iter)
      except StopIteration:
          return None
  
imports: import fnmatch
  import io
  import os
  import shutil
  import tarfile
  from typing import Optional, Tuple, Dict, Generator, Union, List
  import ray
  from ray.util.annotations import DeveloperAPI
  from ray.air._internal.filelock import TempFileLock
  from ray.air.util.node import _get_node_id_from_node_ip, _force_on_node
label_desc: Use image node_id 4 for calling the _PackActor obj's underlying member method code with example usage: obj.next() and returns: next, None