code: def test_append_hierarchical(
      tmp_path, setup_path, multiindex_dataframe_random_data
  ):
      df = multiindex_dataframe_random_data
      df.columns.name = None
  
      with ensure_clean_store(setup_path) as store:
          store.append("mi", df)
          result = store.select("mi")
          tm.assert_frame_equal(result, df)
  
          # GH 3748
          result = store.select("mi", columns=["A", "B"])
          expected = df.reindex(columns=["A", "B"])
          tm.assert_frame_equal(result, expected)
  
      path = tmp_path / "test.hdf"
      df.to_hdf(path, key="df", format="table")
      result = read_hdf(path, "df", columns=["A", "B"])
      expected = df.reindex(columns=["A", "B"])
      tm.assert_frame_equal(result, expected)
  
imports: import datetime
  from datetime import timedelta
  import re
  import numpy
  import pytest
  from pandas._libs.tslibs import Timestamp
  import pandas
  from pandas import DataFrame, Index, Series, _testing, concat, date_range, read_hdf
  from pandas.tests.io.pytables.common import _maybe_remove, ensure_clean_store
label_desc: Use image node_id 10 for calling a global function with example usage: test_append_hierarchical(tmp_path, setup_path, multiindex_dataframe_random_data) without return types