code: def _multidb_testing_config(engines):
      """alembic.ini fixture to work exactly with the 'multidb' template"""
  
      dir_ = os.path.join(_get_staging_directory(), "scripts")
  
      sqlalchemy_future = "future" in config.db.__class__.__module__
  
      databases = ", ".join(engines.keys())
      engines = "\n\n".join(
          "[%s]\n" "sqlalchemy.url = %s" % (key, value.url)
          for key, value in engines.items()
      )
  
      return _write_config_file(
          """
  [alembic]
  script_location = %s
  sourceless = false
  sqlalchemy.future = %s
  databases = %s
  
  %s
  [loggers]
  keys = root
  
  [handlers]
  keys = console
  
  [logger_root]
  level = WARN
  handlers = console
  qualname =
  
  [handler_console]
  class = StreamHandler
  args = (sys.stderr,)
  level = NOTSET
  formatter = generic
  
  [formatters]
  keys = generic
  
  [formatter_generic]
  format = %%(levelname)-5.5s [%%(name)s] %%(message)s
  datefmt = %%H:%%M:%%S
      """
          % (
              dir_,
              "true" if sqlalchemy_future else "false",
              databases,
              engines,
          )
      )
  
imports: import importlib.machinery
  import os
  import shutil
  import textwrap
  from sqlalchemy.testing import config
  from sqlalchemy.testing import provision
  from .None import util
  from ..None import command
  from ..None import script
  from ..None import util
  from ..script import Script
  from ..script import ScriptDirectory
label_desc: Use image node_id 16 for calling a global function with example usage: _multidb_testing_config(engines) and returns: _write_config_file