code: def check_compress_dir(ext, path=None, name=None):
      archive = name + ext
      compress_files(
          [os.path.basename(path)], archive, path=os.path.dirname(path)
      )
      assert_true(op.exists(archive))
      name_extracted = name + "_extracted"
      decompress_file(
          archive, name_extracted, leading_directories="strip"
      )
      assert_true(op.exists(op.join(name_extracted, "empty")))
      assert_true(op.exists(op.join(name_extracted, "d1", "d2", "f1")))
  
imports: import itertools
  import os
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.support import path
  from datalad.support.archive_utils_patool import unixify_path
  from datalad.support.archives import ArchivesCache, ExtractedArchive, compress_files, decompress_file
  from datalad.support.exceptions import MissingExternalDependency
  from datalad.support.external_versions import external_versions
  from datalad.tests.utils_pytest import OBSCURE_FILENAME, SkipTest, assert_false, assert_raises, assert_true, eq_, ok_file_has_content, ok_generator, on_nfs, on_travis, on_windows, skip_if, swallow_outputs, with_tempfile, with_tree
  import mimetypes
label_desc: Use image node_id 4 for calling a global function with example usage: check_compress_dir(ext, path, name) without return types