code: def _xl_table_formula(
      df: DataFrame, cols: Iterable[str], func: str
  ) -> str:
      """Return a formula using structured references to columns in a named table."""
      m: dict[str, Any] = {}
      if isinstance(cols, str):
          cols = [cols]
      if _adjacent_cols(df, cols, min_max=m):
          return f"={func.upper()}([@[{m['min']['name']}]:[{m['max']['name']}]])"
      else:
          colrefs = ",".join(f"[@[{c}]]" for c in cols)
          return f"={func.upper()}({colrefs})"
  
imports: from __future__ import annotations
  from io import BytesIO
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Iterable, Sequence, overload
  from polars import functions
  from polars.datatypes import FLOAT_DTYPES, INTEGER_DTYPES, Date, Datetime, Float64, List, Object, Struct, Time
  from polars.dependencies import json
  from polars.exceptions import DuplicateError
  from polars.selectors import _expand_selector_dicts, _expand_selectors
label_desc: Use image node_id 15 for calling a global function with example usage: _xl_table_formula(df, cols, func) and returns: str, func, str, m, str, m, str, str, func, str, colrefs, str