code: def test_custom_anom_dataset():
      data_dir = os.path.join(rootdir, "data", "synthetic_anomaly")
      dataset = CustomAnomalyDataset(
          rootdir=data_dir,
          test_frac=0.75,
          time_unit="s",
          assume_no_anomaly=True,
      )
      assert len(dataset) == len(
          glob.glob(os.path.join(data_dir, "*.csv"))
      )
      assert all(
          "anomaly" in md.columns and "trainval" in md.columns
          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 1 for calling a global function with example usage: test_custom_anom_dataset() without return types