code: def test_setting_default_allow_sql(default_allow_sql):
      runner = CliRunner()
      result = runner.invoke(
          cli,
          [
              "--setting",
              "default_allow_sql",
              "on" if default_allow_sql else "off",
              "--get",
              "/_memory.json?sql=select+21&_shape=objects",
          ],
      )
      if default_allow_sql:
          assert result.exit_code == 0, result.output
          assert json.loads(result.output)["rows"][0] == {"21": 21}
      else:
          assert result.exit_code == 1, result.output
          # This isn't JSON at the moment, maybe it should be though
          assert "Forbidden" in result.output
  
imports: from .fixtures import app_client, make_app_client, TestClient, EXPECTED_PLUGINS
  import asyncio
  from datasette.app import SETTINGS
  from datasette.plugins import DEFAULT_PLUGINS
  from datasette.cli import cli, serve
  from datasette.version import __version__
  from datasette.utils import tilde_encode
  from datasette.utils.sqlite import sqlite3
  from click.testing import CliRunner
  import io
  import json
  import pathlib
  import pytest
  import sys
  import textwrap
  from unittest import mock
  import urllib
label_desc: Use image node_id 18 for calling a global function with example usage: test_setting_default_allow_sql(default_allow_sql) without return types