def METHOD_NAME(engine, table_names, metadata):
    with engine.begin() as connection:
        migration_context = get_migration_context(connection, table_names)
        raw_diffs = compare_metadata(migration_context, metadata)
        return [
            diff for diff in reformat_alembic_diffs(raw_diffs)
            if diff.table_name in table_names
        ]