code: def _neurovault_one_collection(parts):
      """
      Mocks Neurovault API behind the `/api/collections/<somecollectionid>` path.
  
      parts: parts of the URL path after "collections",
        ie ["<somecollectionid>"] or ["<somecollectionid>", "images"]
  
      returns a dictionary of API results
  
      See the neurovault API docs for details: https://neurovault.org/api-docs
  
      """
      col_id = int(parts[0])
      collections, images = _get_neurovault_data()
      if col_id not in collections.index:
          return {"detail": "Not found."}
      if len(parts) == 1:
          return collections.loc[col_id].to_dict()
      if parts[1] != "images":
          return ""
      col_images = images[images["collection_id"] == col_id]
      return {
          "count": len(col_images),
          "results": col_images.to_dict(orient="records"),
      }
  
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 4 for calling a global function with example usage: _neurovault_one_collection(parts) and returns: dict, dict, collections, str