code: def check_compress_file(ext, annex, path=None, name=None):
      # we base the archive name on the filename, in order to also
      # be able to properly test compressors where the corresponding
      # archive format has no capability of storing a filename
      # (i.e. where the archive name itself determines the filename
      # of the decompressed file, like .xz)
      archive = op.join(name, _filename + ext)
      compress_files([_filename], archive, path=path)
      assert_true(op.exists(archive))
      if annex:
          # It should work even when file is annexed and is a symlink to the
          # key
          from datalad.support.annexrepo import AnnexRepo
  
          repo = AnnexRepo(path, init=True)
          repo.add(_filename)
          repo.commit(files=[_filename], msg="commit")
  
      dir_extracted = name + "_extracted"
      try:
          decompress_file(archive, dir_extracted)
      except MissingExternalDependency as exc:
          raise SkipTest() from exc
      _filepath = op.join(dir_extracted, _filename)
  
      ok_file_has_content(_filepath, "content")
  
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 6 for calling a global function with example usage: check_compress_file(ext, annex, path, name) without return types