code: def test_fetch_ds000030_urls():
      with tempfile.TemporaryDirectory() as tmpdir:
          dataset_version = "ds000030_R1.0.4"
          subdir_names = ["ds000030", "ds000030_R1.0.4", "uncompressed"]
          tmp_list = []
          for subdir in subdir_names:
              tmp_list.append(subdir)
              subdirpath = os.path.join(tmpdir, *tmp_list)
              os.mkdir(subdirpath)
  
          filepath = os.path.join(subdirpath, "urls.json")
          mock_json_content = ["junk1", "junk2"]
          with open(filepath, "w") as f:
              json.dump(mock_json_content, f)
  
          # fetch_ds000030_urls should retrieve the appropriate URLs
          urls_path, urls = func.fetch_ds000030_urls(
              data_dir=tmpdir,
              verbose=1,
          )
          urls_path = urls_path.replace("/", os.sep)
  
          assert urls_path == filepath
          assert urls == mock_json_content
  
          # fetch_openneuro_dataset_index should do the same, but with a warning
          with pytest.warns(DeprecationWarning):
              urls_path, urls = func.fetch_openneuro_dataset_index(
                  data_dir=tmpdir,
                  dataset_version=dataset_version,
                  verbose=1,
              )
  
          urls_path = urls_path.replace("/", os.sep)
  
          assert urls_path == filepath
          assert urls == mock_json_content
  
          # fetch_openneuro_dataset_index should even grab ds000030 when you
          # provide a different dataset name
          with pytest.warns(
              UserWarning,
              match='"ds000030_R1.0.4" will be downloaded',
          ):
              urls_path, urls = func.fetch_openneuro_dataset_index(
                  data_dir=tmpdir,
                  dataset_version="ds500_v2",
                  verbose=1,
              )
  
          urls_path = urls_path.replace("/", os.sep)
  
          assert urls_path == filepath
          assert urls == mock_json_content
  
imports: import json
  import os
  import re
  import shutil
  import tempfile
  import uuid
  from collections import OrderedDict
  from pathlib import Path
  import nibabel
  import numpy
  import pandas
  import pytest
  from nilearn.datasets import func
  from nilearn.datasets._utils import get_dataset_dir
  from nilearn.datasets.tests._testing import dict_to_archive, list_to_archive
  from nilearn.image import load_img
label_desc: Use image node_id 30 for calling a global function with example usage: test_fetch_ds000030_urls() without return types