code: def test_download_image_terms_error(tmp_path, request_mocker):
      image_info = {"id": "a"}
      collection = {
          "relative_path": "collection",
          "absolute_path": tmp_path / "collection",
      }
      os.makedirs(collection["absolute_path"])
      download_params = {
          "temp_dir": tmp_path,
          "verbose": 3,
          "fetch_neurosynth_words": True,
      }
      request_mocker.url_mapping["*"] = requests.RequestException()
      download_params["allow_neurosynth_failure"] = False
  
      with pytest.raises(RuntimeError):
          neurovault._download_image_terms(
              image_info,
              collection,
              download_params,
          )
      # no fail if file already exists
      with open(
          os.path.join(
              collection["absolute_path"],
              "neurosynth_words_for_image_a.json",
          ),
          "w",
      ):
          pass
      neurovault._download_image_terms(
          image_info, collection, download_params
      )
  
imports: import hashlib
  import json
  import os
  import re
  import stat
  from urllib import parse
  import numpy
  import pandas
  import pytest
  import requests
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.conftest import _rng
  from nilearn.datasets import neurovault
  from nilearn.image import load_img
label_desc: Use image node_id 38 for calling a global function with example usage: test_download_image_terms_error(tmp_path, request_mocker) without return types