code: def _get_neurovault_data():
      """Make fake images and collections to mock neurovault in the unit tests.
  
      Returns two pandas DataFrames: collections and images. Each row contains
      some metadata (e.g. "map_type", "is_thresholded" for images, or
      "number_of_images" for collections) for a single (fake) image or
      collection.
  
      These two dataframes are like a fake neurovault database and the
      `_neurovault` function, used to simulate responses from the neurovault
      API, uses this data.
  
      """
      if getattr(_get_neurovault_data, "data", None) is not None:
          return _get_neurovault_data.data
      rng = _rng()
      n_collections, n_images = 73, 546
      collection_ids = rng.choice(
          np.arange(1000), size=n_collections, replace=False
      )
      collections = pd.DataFrame({"id": collection_ids})
      image_ids = rng.choice(
          np.arange(10000), size=n_images, replace=False
      )
      images = pd.DataFrame({"id": image_ids})
      not_empty = rng.binomial(1, 0.9, n_collections).astype(bool)
      images["collection_id"] = rng.choice(
          collection_ids[not_empty], size=n_images
      )
      collection_sizes = images.groupby("collection_id").count()
      collections["true_number_of_images"] = collection_sizes.reindex(
          index=collections["id"].values, fill_value=0
      ).values
      collections["number_of_images"] = collections[
          "true_number_of_images"
      ] + rng.binomial(1, 0.1, n_collections) * rng.integers(
          0, 100, n_collections
      )
      images["not_mni"] = rng.binomial(1, 0.1, size=n_images).astype(
          bool
      )
      images["is_valid"] = rng.binomial(1, 0.1, size=n_images).astype(
          bool
      )
      images["is_thresholded"] = rng.binomial(
          1, 0.1, size=n_images
      ).astype(bool)
      images["map_type"] = rng.choice(
          [
              "T map",
              "Z map",
              "ROI/mask",
              "anatomical",
              "parcellation",
              "something else",
          ],
          size=n_images,
          p=[0.4, 0.3, 0.1, 0.1, 0.05, 0.05],
      )
      images["image_type"] = rng.choice(
          ["statistic_map", "atlas", "other type"],
          size=n_images,
          p=[0.4, 0.4, 0.2],
      )
      images["some_key"] = "some_value"
      images[13] = rng.standard_normal(n_images)
      url = "https://neurovault.org/media/images/{}/{}.nii.gz"
      image_names = [
          hashlib.sha1(bytes(img_id)).hexdigest()[:4]
          for img_id in image_ids
      ]
      images["file"] = [
          url.format(col_id, img_name)
          for (col_id, img_name) in zip(
              images["collection_id"], image_names
          )
      ]
      collections.set_index("id", inplace=True, drop=False)
      images.set_index("id", inplace=True, drop=False)
      _get_neurovault_data.data = collections, images
      return collections, images
  
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 1 for calling a global function with example usage: _get_neurovault_data() and returns: collections,  images, _get_neurovault_data