parameters: (path, zf)
docstring: Zip all the files in a directory in a determinisitc order along with a constant timestamp
docstring_summary: Zip all the files in a directory in a determinisitc order along with a constant timestamp
docstring_tokens: Zip all the files in a directory in a determinisitc order along with a constant timestamp
function: def _zipdir(path, zf):
      """
      Zip all the files in a directory in a determinisitc order along with a constant timestamp
      """
      files_to_add = []
      for root, dirs, files in os.walk(path):
          for file in files:
              abspath = os.path.join(root, file)
              relpath = os.path.relpath(abspath, path)
  
              files_to_add.append((relpath, abspath))
  
      # Sort by the relative path
      files_to_add.sort()
  
      for relpath, abspath in files_to_add:
          # Set the modification time to a deterministic value
          os.utime(abspath, (zip_modtime, zip_modtime))
  
          # Add to the zip file
          zf.write(abspath, arcname=relpath)
function_tokens: def _zipdir ( path , zf ) : files_to_add = [ ] for root , dirs , files in os . walk ( path ) : for file in files : abspath = os . path . join ( root , file ) relpath = os . path . relpath ( abspath , path ) files_to_add . append ( ( relpath , abspath ) ) # Sort by the relative path files_to_add . sort ( ) for relpath , abspath in files_to_add : # Set the modification time to a deterministic value os . utime ( abspath , ( zip_modtime , zip_modtime ) ) # Add to the zip file zf . write ( abspath , arcname = relpath )