code: def _neurovault(match, request):
      """Mock response content from the Neurovault API.
  
      The fake data used to generate responses is provided by
      `_get_neurovault_data`.
  
      See the neurovault API docs for details on the queries and corresponding
      responses: https://neurovault.org/api-docs
  
      """
      handlers = {
          "media": {"images": _neurovault_file},
          "api": {
              "collections": _neurovault_collections,
              "images": _neurovault_images,
          },
      }
      info = parse.urlparse(request.url)
      parts = list(filter(bool, info.path.split("/")))
      endpoint, section = parts[0], parts[1]
  
      result = handlers[endpoint][section](
          parts[2:], _parse_query(info.query)
      )
      should_jsonify_response = endpoint == "api"
      return (
          json.dumps(result, cls=_NumpyJsonEncoder).encode("UTF-8")
          if should_jsonify_response
          else result
      )
  
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 8 for calling a global function with example usage: _neurovault(match, request) and returns: unknown