code: def _parse_query(query):
      """Extract key-value pairs from a url query string.
  
      for example
      "collection=23&someoption&format=json"
        -> {"collection": "23", "someoption": None, "format": "json"}
  
      """
      parts = [p.split("=") for p in query.split("&")]
      result = {}
      for p in parts:
          if len(p) == 2:
              result[p[0]] = p[1]
          if len(p) == 1:
              result[p[0]] = None
      return 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 2 for calling a global function with example usage: _parse_query(query) and returns: result