code: def check_dataset(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}"
  
file_path: gluonts/src/gluonts/dataset/repository/_m3.py
imports: import os
  import warnings
  from pathlib import Path
  from typing import NamedTuple, Optional
  import numpy
  import pandas
  from gluonts.dataset import DatasetWriter
  from gluonts.dataset.common import MetaData, TrainDatasets
  from gluonts.dataset.repository._util import metadata
  from gluonts.gluonts_tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: check_dataset(dataset_path, length, sheet_name) without return types