code: def test_create_table_index(setup_path):
      with ensure_clean_store(setup_path) as store:
  
          def col(t, column):
              return getattr(store.get_storer(t).table.cols, column)
  
          # data columns
          df = DataFrame(
              np.random.default_rng(2).standard_normal((10, 4)),
              columns=Index(list("ABCD"), dtype=object),
              index=date_range("2000-01-01", periods=10, freq="B"),
          )
          df["string"] = "foo"
          df["string2"] = "bar"
          store.append("f", df, data_columns=["string", "string2"])
          assert col("f", "index").is_indexed is True
          assert col("f", "string").is_indexed is True
          assert col("f", "string2").is_indexed is True
  
          # specify index=columns
          store.append(
              "f2",
              df,
              index=["string"],
              data_columns=["string", "string2"],
          )
          assert col("f2", "index").is_indexed is False
          assert col("f2", "string").is_indexed is True
          assert col("f2", "string2").is_indexed is False
  
          # try to index a non-table
          _maybe_remove(store, "f2")
          store.put("f2", df)
          msg = "cannot create table index on a Fixed format store"
          with pytest.raises(TypeError, match=msg):
              store.create_table_index("f2")
  
imports: import contextlib
  import datetime
  import hashlib
  import tempfile
  import time
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, concat, date_range, period_range, timedelta_range
  import pandas._testing
  from pandas.tests.io.pytables.common import _maybe_remove, ensure_clean_store
  from pandas.io.pytables import HDFStore, read_hdf
label_desc: Use image node_id 13 for calling a global function with example usage: test_create_table_index(setup_path) and returns: getattr