code: def make_app_client(
      sql_time_limit_ms=None,
      max_returned_rows=None,
      cors=False,
      memory=False,
      settings=None,
      filename="fixtures.db",
      is_immutable=False,
      extra_databases=None,
      inspect_data=None,
      static_mounts=None,
      template_dir=None,
      config=None,
      metadata=None,
      crossdb=False,
  ):
      with tempfile.TemporaryDirectory() as tmpdir:
          filepath = os.path.join(tmpdir, filename)
          if is_immutable:
              files = []
              immutables = [filepath]
          else:
              files = [filepath]
              immutables = []
          conn = sqlite3.connect(filepath)
          conn.executescript(TABLES)
          for sql, params in TABLE_PARAMETERIZED_SQL:
              with conn:
                  conn.execute(sql, params)
          # Close the connection to avoid "too many open files" errors
          conn.close()
          if extra_databases is not None:
              for extra_filename, extra_sql in extra_databases.items():
                  extra_filepath = os.path.join(tmpdir, extra_filename)
                  c2 = sqlite3.connect(extra_filepath)
                  c2.executescript(extra_sql)
                  c2.close()
                  # Insert at start to help test /-/databases ordering:
                  files.insert(0, extra_filepath)
          os.chdir(os.path.dirname(filepath))
          settings = settings or {}
          for key, value in {
              "default_page_size": 50,
              "max_returned_rows": max_returned_rows or 100,
              "sql_time_limit_ms": sql_time_limit_ms or 200,
              # Default is 3 but this results in "too many open files"
              # errors when running the full test suite:
              "num_sql_threads": 1,
          }.items():
              if key not in settings:
                  settings[key] = value
          ds = Datasette(
              files,
              immutables=immutables,
              memory=memory,
              cors=cors,
              metadata=metadata or METADATA,
              config=config or CONFIG,
              plugins_dir=PLUGINS_DIR,
              settings=settings,
              inspect_data=inspect_data,
              static_mounts=static_mounts,
              template_dir=template_dir,
              crossdb=crossdb,
          )
          yield TestClient(ds)
          # Close as many database connections as possible
          # to try and avoid too many open files error
          for db in ds.databases.values():
              if not db.is_memory:
                  db.close()
  
imports: from datasette.app import Datasette
  from datasette.utils.sqlite import sqlite3
  from datasette.utils.testing import TestClient
  import click
  import contextlib
  import itertools
  import json
  import os
  import pathlib
  import pytest
  import random
  import string
  import tempfile
  import textwrap
label_desc: Use image node_id 1 for calling a global function with example usage: make_app_client(sql_time_limit_ms, max_returned_rows, cors, memory, settings, filename, is_immutable, extra_databases, inspect_data, static_mounts, template_dir, config, metadata, crossdb) without return types