code: def test_fetch_oasis_vbm(tmp_path, request_mocker, legacy_format):
      request_mocker.url_mapping[
          "*archive_dartel.tgz*"
      ] = _make_oasis_data()
      request_mocker.url_mapping["*archive.tgz*"] = _make_oasis_data(
          False
      )
  
      dataset = struct.fetch_oasis_vbm(
          data_dir=str(tmp_path), verbose=0, legacy_format=legacy_format
      )
  
      assert len(dataset.gray_matter_maps) == 403
      assert len(dataset.white_matter_maps) == 403
      assert isinstance(dataset.gray_matter_maps[0], str)
      assert isinstance(dataset.white_matter_maps[0], str)
      if legacy_format:
          assert isinstance(dataset.ext_vars, np.recarray)
      else:
          assert isinstance(dataset.ext_vars, pd.DataFrame)
      assert isinstance(dataset.data_usage_agreement, str)
      assert request_mocker.url_count == 1
  
      dataset = struct.fetch_oasis_vbm(
          data_dir=str(tmp_path),
          dartel_version=False,
          verbose=0,
          legacy_format=legacy_format,
      )
  
      assert len(dataset.gray_matter_maps) == 415
      assert len(dataset.white_matter_maps) == 415
      assert isinstance(dataset.gray_matter_maps[0], str)
      assert isinstance(dataset.white_matter_maps[0], str)
      if legacy_format:
          assert isinstance(dataset.ext_vars, np.recarray)
      else:
          assert isinstance(dataset.ext_vars, pd.DataFrame)
      assert isinstance(dataset.data_usage_agreement, str)
      assert request_mocker.url_count == 2
      assert dataset.description != ""
  
file_path: nilearn/nilearn/datasets/tests/test_struct.py
imports: from pathlib import Path
  import numpy
  import pandas
  import pytest
  from nibabel import Nifti1Image
  from nilearn.datasets import struct
  from nilearn.datasets.tests._testing import dict_to_archive, list_to_archive
label_desc: Use image node_id 3 for calling a global function with example usage: test_fetch_oasis_vbm(tmp_path, request_mocker, legacy_format) without return types