code: def test_sender_regex(request_mocker):
      url = "https://example.org/info?key=value&name=nilearn"
      pattern = re.compile(
          r".*example.org/(?P<section>.*)\?.*name=(?P<name>[^&]+)"
      )
      request_mocker.url_mapping[pattern] = r"in \g<section>: hello \2"
      resp = requests.get(url)
  
      assert resp.text == "in info: hello nilearn"
  
      def f(match, request):
          return f"name: {match.group('name')}, url: {request.url}"
  
      request_mocker.url_mapping[pattern] = f
      resp = requests.get(url)
  
      assert resp.text == f"name: nilearn, url: {url}"
  
      def g(match, request):
          return 403
  
      request_mocker.url_mapping[pattern] = g
      resp = requests.get(url)
      with pytest.raises(requests.HTTPError, match="Error"):
          resp.raise_for_status()
  
imports: import re
  import tarfile
  import zipfile
  from pathlib import Path
  import pytest
  import requests
  from nilearn import image
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.datasets.tests import _testing
label_desc: Use image node_id 3 for calling a global function with example usage: test_sender_regex(request_mocker) and returns: str, match, str, request, int