code: def test_magic_parameters(
      magic_parameters_client, magic_parameter, expected_re
  ):
      magic_parameters_client.ds.config["databases"]["data"]["queries"][
          "runme_post"
      ]["sql"] = f"insert into logs (line) values (:{magic_parameter})"
      magic_parameters_client.ds.config["databases"]["data"]["queries"][
          "runme_get"
      ]["sql"] = f"select :{magic_parameter} as result"
      cookies = {
          "ds_actor": magic_parameters_client.actor_cookie(
              {"id": "root"}
          ),
          "foo": "bar",
      }
      # Test the GET version
      get_response = magic_parameters_client.get(
          "/data/runme_get.json?_shape=array", cookies=cookies
      )
      get_actual = get_response.json[0]["result"]
      assert re.match(expected_re, str(get_actual))
      # Test the form
      form_response = magic_parameters_client.get("/data/runme_post")
      soup = Soup(form_response.body, "html.parser")
      # The magic parameter should not be represented as a form field
      assert None is soup.find("input", {"name": magic_parameter})
      # Submit the form to create a log line
      response = magic_parameters_client.post(
          "/data/runme_post?_json=1",
          {},
          csrftoken_from=True,
          cookies=cookies,
      )
      assert response.json == {
          "ok": True,
          "message": "Query executed, 1 row affected",
          "redirect": None,
      }
      post_actual = magic_parameters_client.get(
          "/data/logs.json?_sort_desc=rowid&_shape=array"
      ).json[0]["line"]
      assert re.match(expected_re, post_actual)
  
imports: from bs4 import BeautifulSoup
  import json
  import pytest
  import re
  from .fixtures import make_app_client, app_client
label_desc: Use image node_id 18 for calling a global function with example usage: test_magic_parameters(magic_parameters_client, magic_parameter, expected_re) without return types