def METHOD_NAME(dataset_path: Path, length: int, sheet_name):
    # check that things are correct
    from gluonts.dataset.common import load_datasets
    ds = load_datasets(
        metadata=dataset_path,
        train=dataset_path / "train",
        test=dataset_path / "test",
    )
    assert ds.test is not None
    assert len(list(ds.train)) == length
    assert len(list(ds.test)) == length
    assert ds.metadata.prediction_length is not None
    for ts_train, ts_test in tqdm(
        zip(ds.train, ds.test), total=length, desc="checking consistency"
    ):
        train_target = ts_train["target"]
        test_target = ts_test["target"]
        assert (
            len(train_target)
            == len(test_target) - ds.metadata.prediction_length
        )
        assert np.all(train_target == test_target[: len(train_target)])
        assert ts_train["start"] == ts_test["start"]
        start = ts_train["start"]
        if sheet_name in ["M3Quart", "Other"]:
            assert (start.month, start.day) in [
                (3, 31),
                (6, 30),
                (9, 30),
                (12, 31),
            ], f"Invalid time stamp {start.month}-{start.day}"
        elif sheet_name == "M3Year":
            assert (start.month, start.day) == (
                12,
                31,
            ), f"Invalid time stamp {start.month}-{start.day}"