code: def cli(
      db_filename,
      config,
      metadata,
      plugins_path,
      recreate,
      extra_db_filename,
  ):
      """Write out the fixtures database used by Datasette's test suite"""
      if metadata and not metadata.endswith(".json"):
          raise click.ClickException("Metadata should end with .json")
      if not db_filename.endswith(".db"):
          raise click.ClickException(
              "Database file should end with .db"
          )
      if pathlib.Path(db_filename).exists():
          if not recreate:
              raise click.ClickException(
                  f"{db_filename} already exists, use --recreate to reset it"
              )
          else:
              pathlib.Path(db_filename).unlink()
      conn = sqlite3.connect(db_filename)
      conn.executescript(TABLES)
      for sql, params in TABLE_PARAMETERIZED_SQL:
          with conn:
              conn.execute(sql, params)
      print(f"Test tables written to {db_filename}")
      if metadata:
          with open(metadata, "w") as fp:
              fp.write(json.dumps(METADATA, indent=4))
          print(f"- metadata written to {metadata}")
      if config:
          with open(config, "w") as fp:
              fp.write(json.dumps(CONFIG, indent=4))
          print(f"- config written to {config}")
      if plugins_path:
          path = pathlib.Path(plugins_path)
          if not path.exists():
              path.mkdir()
          test_plugins = pathlib.Path(__file__).parent / "plugins"
          for filepath in test_plugins.glob("*.py"):
              newpath = path / filepath.name
              newpath.write_text(filepath.read_text())
              print(f"  Wrote plugin: {newpath}")
      if extra_db_filename:
          if pathlib.Path(extra_db_filename).exists():
              if not recreate:
                  raise click.ClickException(
                      f"{extra_db_filename} already exists, use --recreate to reset it"
                  )
              else:
                  pathlib.Path(extra_db_filename).unlink()
          conn = sqlite3.connect(extra_db_filename)
          conn.executescript(EXTRA_DATABASE_SQL)
          print(f"Test tables written to {extra_db_filename}")
  
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 20 for calling a global function with example usage: cli(db_filename, config, metadata, plugins_path, recreate, extra_db_filename) without return types