code: def cleanse(tarinfo):
      """Cleanse sources of nondeterminism from tar entries.
  
      To be passed as the `filter` kwarg to `tarfile.TarFile.add`.
  
      Args:
        tarinfo: A `tarfile.TarInfo` object to be mutated.
  
      Returns:
        The same `tarinfo` object, but mutated.
      """
      tarinfo.uid = 0
      tarinfo.gid = 0
      tarinfo.uname = "root"
      tarinfo.gname = "root"
      tarinfo.mtime = 0
      return tarinfo
  
imports: import argparse
  import gzip
  import os
  import sys
  import tarfile
label_desc: Use image node_id 2 for calling a global function with example usage: cleanse(tarinfo) and returns: tarinfo