def resume_file_upload(vault, upload_id, part_size, fobj, part_hash_map, chunk_size=_ONE_MEGABYTE):
 uploader = _Uploader(vault, upload_id, part_size, chunk_size)
 for (part_index, part_data) in enumerate(generate_parts_from_fobj(fobj, part_size)):
  part_tree_hash = tree_hash(chunk_hashes(part_data, chunk_size))
  if ((part_index not in part_hash_map) or (part_hash_map[part_index] != part_tree_hash)):
   uploader.upload_part(part_index, part_data)
  else:
   uploader.skip_part(part_index, part_tree_hash, len(part_data))
 uploader.close()
 return uploader.archive_id

def resume_file_upload ( vault , upload_id , part_size , fobj , part_hash_map , chunk_size = _ONE_MEGABYTE ) : uploader = _Uploader ( vault , upload_id , part_size , chunk_size ) for ( part_index , part_data ) in enumerate ( generate_parts_from_fobj ( fobj , part_size ) ) : part_tree_hash = tree_hash ( chunk_hashes ( part_data , chunk_size ) ) if ( ( part_index not in part_hash_map ) or ( part_hash_map [ part_index ] != part_tree_hash ) ) : uploader . upload_part ( part_index , part_data ) else : uploader . skip_part ( part_index , part_tree_hash , len ( part_data ) ) uploader . close ( ) return uploader . archive_id
resume upload of a file already part-uploaded to glacier .