code: def tar(output, files):
      """Create tarball containing all files in root.
  
      Parameters
      ----------
      output : str
          The target shared library.
  
      files : list
          List of files to be bundled.
      """
      cmd = ["tar"]
      cmd += ["-czf"]
      temp = utils.tempdir()
      fset = set()
      for fname in files:
          base = os.path.basename(fname)
          if base in fset:
              raise ValueError(f"duplicate file name {base}")
          fset.add(base)
          shutil.copy(fname, temp.relpath(base))
      cmd += [output]
      cmd += ["-C", temp.temp_dir]
      cmd += temp.listdir()
      proc = subprocess.Popen(
          cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
      )
      (out, _) = proc.communicate()
  
      if proc.returncode != 0:
          msg = "Tar error:\n"
          msg += py_str(out)
          raise RuntimeError(msg)
  
file_path: tvm/python/tvm/contrib/tar.py
imports: from __future__ import absolute_import
  import os
  import shutil
  import subprocess
  from .None import utils
  from .._ffi.base import py_str
label_desc: Use image node_id 1 for calling a global function with example usage: tar(output, files) without return types