code: def test_custom_dataset():
      csv = os.path.join(rootdir, "data", "walmart", "walmart_mini.csv")
      index_cols = ["Store", "Dept"]
      data_cols = ["Weekly_Sales", "Temperature", "CPI"]
      df = pd.read_csv(csv, index_col=[0, 1, 2], parse_dates=True)
      dataset = CustomDataset(
          rootdir=csv,
          test_frac=0.25,
          data_cols=data_cols,
          index_cols=index_cols,
      )
      assert len(dataset) == len(df.groupby(index_cols).groups)
      assert all(list(ts.columns) == data_cols for ts, md in dataset)
      assert all(
          (c in md.columns for c in ["trainval"] + index_cols)
          for ts, md in dataset
      )
      assert all(
          abs((~md.trainval).mean() - dataset.test_frac) < 2 / len(ts)
          for ts, md in dataset
      )
  
imports: import glob
  import os
  import pandas
  from ts_datasets.forecast import CustomDataset
  from ts_datasets.anomaly import CustomAnomalyDataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_custom_dataset() without return types