code: def rebuild(
      filename, tag=None, format="gz", zonegroups=[], metadata=None
  ):
      """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
  
      filename is the timezone tarball from ``ftp.iana.org/tz``.
  
      """
      tmpdir = tempfile.mkdtemp()
      zonedir = os.path.join(tmpdir, "zoneinfo")
      moduledir = os.path.dirname(__file__)
      try:
          with TarFile.open(filename) as tf:
              for name in zonegroups:
                  tf.extract(name, tmpdir)
              filepaths = [os.path.join(tmpdir, n) for n in zonegroups]
  
              _run_zic(zonedir, filepaths)
  
          # write metadata file
          with open(os.path.join(zonedir, METADATA_FN), "w") as f:
              json.dump(metadata, f, indent=4, sort_keys=True)
          target = os.path.join(moduledir, ZONEFILENAME)
          with TarFile.open(target, "w:%s" % format) as tf:
              for entry in os.listdir(zonedir):
                  entrypath = os.path.join(zonedir, entry)
                  tf.add(entrypath, entry)
      finally:
          shutil.rmtree(tmpdir)
  
file_path: catboost/contrib/python/python-dateutil/py3/dateutil/zoneinfo/rebuild.py
imports: import logging
  import os
  import tempfile
  import shutil
  import json
  from subprocess import check_call, check_output
  from tarfile import TarFile
  from dateutil.zoneinfo import METADATA_FN, ZONEFILENAME
label_desc: Use image node_id 1 for calling a global function with example usage: rebuild(filename, tag, format, zonegroups, metadata) without return types