code: def test_loading_from_archive_contents(tmp_path):
      expected_contents = sorted(
          [
              Path("README.txt"),
              Path("data"),
              Path("data", "img.nii.gz"),
              Path("data", "labels.csv"),
          ]
      )
      resp = requests.get("https://example.org/example_zip")
      file_path = tmp_path / "archive.zip"
      file_path.write_bytes(resp.content)
      zip_extract_dir = tmp_path / "extract_zip"
      zip_extract_dir.mkdir()
  
      with zipfile.ZipFile(str(file_path)) as zipf:
          assert sorted(map(Path, zipf.namelist())) == expected_contents
          zipf.extractall(str(zip_extract_dir))
  
      labels_file = zip_extract_dir / "data" / "labels.csv"
  
      assert labels_file.read_bytes() == b""
  
      for url_end in ["_default_format", "_tar_gz"]:
          resp = requests.get(f"https://example.org/example{url_end}")
          file_path = tmp_path / "archive.tar.gz"
          file_path.write_bytes(resp.content)
          tar_extract_dir = tmp_path / f"extract_tar{url_end}"
          tar_extract_dir.mkdir()
  
          with tarfile.open(str(file_path)) as tarf:
              assert (
                  sorted(map(Path, tarf.getnames()))
                  == [Path(".")] + expected_contents
              )
              tarf.extractall(str(tar_extract_dir))
  
          labels_file = tar_extract_dir / "data" / "labels.csv"
  
          assert labels_file.read_bytes() == b""
  
imports: import re
  import tarfile
  import zipfile
  from pathlib import Path
  import pytest
  import requests
  from nilearn import image
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.datasets.tests import _testing
label_desc: Use image node_id 2 for calling a global function with example usage: test_loading_from_archive_contents(tmp_path) without return types