code: def main(db, schema_name, table_number, min_cols, max_cols, args):
      timing = timer()
      if args.pool_class:
          engine = sa.create_engine(
              db,
              echo=args.echo,
              poolclass=getattr(sa.pool, args.pool_class),
              future=True,
          )
      else:
          engine = sa.create_engine(db, echo=args.echo, future=True)
  
      if args.drop_all:
          return drop_all(engine, schema_name)
  
      if engine.name == "oracle":
          # clear out oracle caches so that we get the real-world time the
          # queries would normally take for scripts that aren't run repeatedly
          with engine.connect() as conn:
              # https://stackoverflow.com/questions/2147456/how-to-clear-all-cached-items-in-oracle
              conn.exec_driver_sql("alter system flush buffer_cache")
              conn.exec_driver_sql("alter system flush shared_pool")
      if not args.no_create:
          print(
              f"Generating {table_number} using engine {engine} in "
              f"schema {schema_name or 'default'}",
          )
      meta = sa.MetaData()
      table_names = []
      stats = {}
      try:
          if not args.no_create:
              with timing("populate-meta"):
                  meta = generate_meta(
                      schema_name,
                      table_number,
                      min_cols,
                      max_cols,
                      engine.name,
                  )
              with timing("create-tables"):
                  create_tables(engine, meta)
  
          with timing("get_table_names"):
              with engine.connect() as conn:
                  table_names = engine.dialect.get_table_names(
                      conn, schema=schema_name
                  )
          print(
              f"Reflected table number {len(table_names)} in "
              f"schema {schema_name or 'default'}"
          )
          mode = {"single", "multi"}
          if args.multi_only:
              mode.discard("single")
          if args.single_only:
              mode.discard("multi")
  
          if args.sqlstats:
              print("starting stats for subsequent tests")
              stats = _apply_events(engine)
          for test_name, test_fn in tests.items():
              if test_name in args.test or "all" in args.test:
                  test_fn(
                      engine,
                      schema_name,
                      table_names,
                      timing,
                      mode,
                      args.ignore_diff,
                  )
  
          if args.reflect:
              with timing("reflect-tables"):
                  reflect_tables(engine, schema_name)
      finally:
          # copy stats to new dict
          if args.sqlstats:
              stats = dict(stats)
          try:
              if not args.no_drop:
                  with timing("drop-tables"):
                      drop_tables(
                          engine, meta, schema_name, table_names
                      )
          finally:
              pprint(timing.timing, sort_dicts=False)
              if args.sqlstats:
                  _print_query_stats(stats)
  
imports: from argparse import ArgumentDefaultsHelpFormatter
  from argparse import ArgumentParser
  from collections import defaultdict
  from contextlib import contextmanager
  from functools import wraps
  from pprint import pprint
  import random
  import time
  import sqlalchemy
  from sqlalchemy.engine import Inspector
label_desc: Use image node_id 22 for calling a global function with example usage: main(db, schema_name, table_number, min_cols, max_cols, args) and returns: drop_all