code: def _scan_insert_from_select_cols(
      compiler,
      stmt,
      compile_state,
      parameters,
      _getattr_col_key,
      _column_as_key,
      _col_bind_name,
      check_columns,
      values,
      toplevel,
      kw,
  ):
      cols = [
          stmt.table.c[_column_as_key(name)]
          for name in stmt._select_names
      ]
  
      assert compiler.stack[-1]["selectable"] is stmt
  
      compiler.stack[-1]["insert_from_select"] = stmt.select
  
      add_select_cols: List[_CrudParamElementSQLExpr] = []
      if stmt.include_insert_from_select_defaults:
          col_set = set(cols)
          for col in stmt.table.columns:
              # omit columns that were not in the SELECT statement.
              # this will omit columns marked as omit_from_statements naturally,
              # as long as that col was not explicit in the SELECT.
              # if an omit_from_statements col has a "default" on it, then
              # we need to include it, as these defaults should still fire off.
              # but, if it has that default and it's the "sentinel" default,
              # we don't do sentinel default operations for insert_from_select
              # here so we again omit it.
              if (
                  col not in col_set
                  and col.default
                  and not col.default.is_sentinel
              ):
                  cols.append(col)
  
      for c in cols:
          col_key = _getattr_col_key(c)
          if col_key in parameters and col_key not in check_columns:
              parameters.pop(col_key)
              values.append(
                  (c, compiler.preparer.format_column(c), None, ())
              )
          else:
              _append_param_insert_select_hasdefault(
                  compiler, stmt, c, add_select_cols, kw
              )
  
      if add_select_cols:
          values.extend(add_select_cols)
          ins_from_select = compiler.stack[-1]["insert_from_select"]
          if not isinstance(ins_from_select, Select):
              raise exc.CompileError(
                  f"Can't extend statement for INSERT..FROM SELECT to include "
                  f"additional default-holding column(s) "
                  f"""{
                      ', '.join(repr(key) for _, key, _, _ in add_select_cols)
                  }.  Convert the selectable to a subquery() first, or pass """
                  "include_defaults=False to Insert.from_select() to skip these "
                  "columns."
              )
          ins_from_select = ins_from_select._generate()
          # copy raw_columns
          ins_from_select._raw_columns = list(
              ins_from_select._raw_columns
          ) + [expr for _, _, expr, _ in add_select_cols]
          compiler.stack[-1]["insert_from_select"] = ins_from_select
  
imports: from __future__ import annotations
  import functools
  import operator
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import Dict
  from typing import Iterable
  from typing import List
  from typing import MutableMapping
  from typing import NamedTuple
  from typing import Optional
  from typing import overload
  from typing import Sequence
  from typing import Set
  from typing import Tuple
  from typing import TYPE_CHECKING
  from typing import Union
  from .None import coercions
  from .None import dml
  from .None import elements
  from .None import roles
  from .base import _DefaultDescriptionTuple
  from .dml import isinsert
  from .elements import ColumnClause
  from .schema import default_is_clause_element
  from .schema import default_is_sequence
  from .selectable import Select
  from .selectable import TableClause
  from ..None import exc
  from ..None import util
  from ..util.typing import Literal
label_desc: Use image node_id 8 for calling a global function with example usage: _scan_insert_from_select_cols(compiler, stmt, compile_state, parameters, _getattr_col_key, _column_as_key, _col_bind_name, check_columns, values, toplevel, kw) without return types