code: def test_canned_query_form_csrf_hidden_field(
      canned_write_client, query_name, expect_csrf_hidden_field
  ):
      response = canned_write_client.get(f"/data/{query_name}")
      html = response.text
      fragment = '<input type="hidden" name="csrftoken" value="'
      if expect_csrf_hidden_field:
          assert fragment in html
      else:
          assert fragment not in html
  
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 4 for calling a global function with example usage: test_canned_query_form_csrf_hidden_field(canned_write_client, query_name, expect_csrf_hidden_field) without return types