code: def test_write_read_metadata(tmp_path):
      metadata = {
          "relative_path": "collection_1",
          "absolute_path": os.path.join("tmp", "collection_1"),
      }
  
      neurovault._write_metadata(metadata, tmp_path / "metadata.json")
      with open(tmp_path / "metadata.json", "rb") as meta_file:
          written_metadata = json.loads(
              meta_file.read().decode("utf-8")
          )
  
      assert "relative_path" in written_metadata
      assert "absolute_path" not in written_metadata
  
      read_metadata = neurovault._add_absolute_paths(
          "tmp", written_metadata
      )
  
      assert read_metadata["absolute_path"] == os.path.join(
          "tmp", "collection_1"
      )
  
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 30 for calling a global function with example usage: test_write_read_metadata(tmp_path) without return types