code: def test_extract_archive():
      # gzip
      with tempfile.TemporaryDirectory() as src_dir:
          gz_file = "gz_archive"
          gz_path = os.path.join(src_dir, gz_file + ".gz")
          content = b"test extract archive gzip"
          with gzip.open(gz_path, "wb") as f:
              f.write(content)
          with tempfile.TemporaryDirectory() as dst_dir:
              data.utils.extract_archive(
                  gz_path, dst_dir, overwrite=True
              )
              assert os.path.exists(os.path.join(dst_dir, gz_file))
  
      # tar
      with tempfile.TemporaryDirectory() as src_dir:
          tar_file = "tar_archive"
          tar_path = os.path.join(src_dir, tar_file + ".tar")
          # default encode to utf8
          content = "test extract archive tar\n".encode()
          info = tarfile.TarInfo(name="tar_archive")
          info.size = len(content)
          with tarfile.open(tar_path, "w") as f:
              f.addfile(info, io.BytesIO(content))
          with tempfile.TemporaryDirectory() as dst_dir:
              data.utils.extract_archive(
                  tar_path, dst_dir, overwrite=True
              )
              assert os.path.exists(os.path.join(dst_dir, tar_file))
  
file_path: dgl/tests/python/common/data/test_utils.py
imports: import gzip
  import io
  import os
  import tarfile
  import tempfile
  import unittest
  import backend
  import dgl
  import dgl.data
  import numpy
  import pandas
  import pytest
  import yaml
  from dgl import DGLError
label_desc: Use image node_id 2 for calling a global function with example usage: test_extract_archive() without return types