code: def test_remove(setup_path):
      with ensure_clean_store(setup_path) as store:
          ts = Series(
              np.arange(10, dtype=np.float64),
              index=date_range("2020-01-01", periods=10),
          )
          df = DataFrame(
              1.1 * np.arange(120).reshape((30, 4)),
              columns=Index(list("ABCD"), dtype=object),
              index=Index([f"i-{i}" for i in range(30)], dtype=object),
          )
          store["a"] = ts
          store["b"] = df
          _maybe_remove(store, "a")
          assert len(store) == 1
          tm.assert_frame_equal(df, store["b"])
  
          _maybe_remove(store, "b")
          assert len(store) == 0
  
          # nonexistence
          with pytest.raises(
              KeyError,
              match="'No object named a_nonexistent_store in the file'",
          ):
              store.remove("a_nonexistent_store")
  
          # pathing
          store["a"] = ts
          store["b/foo"] = df
          _maybe_remove(store, "foo")
          _maybe_remove(store, "b/foo")
          assert len(store) == 1
  
          store["a"] = ts
          store["b/foo"] = df
          _maybe_remove(store, "b")
          assert len(store) == 1
  
          # __delitem__
          store["a"] = ts
          store["b"] = df
          del store["a"]
          del store["b"]
          assert len(store) == 0
  
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 18 for calling a global function with example usage: test_remove(setup_path) without return types