code: def generate_airpassengers_dataset(
      dataset_path: Path,
      dataset_writer: DatasetWriter,
  ):
      test_split_index = 36
  
      df = pd.read_csv(
          URL,
          index_col=0,
          parse_dates=True,
      )
  
      train = PandasDataset(
          df[:-test_split_index], target="#Passengers"
      )
      test = PandasDataset(df, target="#Passengers")
  
      meta = MetaData(freq="1M", prediction_length=12)
  
      dataset = TrainDatasets(metadata=meta, train=train, test=test)
      dataset.save(
          str(dataset_path), writer=dataset_writer, overwrite=True
      )
  
imports: from pathlib import Path
  import pandas
  from gluonts.dataset import DatasetWriter
  from gluonts.dataset.common import MetaData, TrainDatasets
  from gluonts.dataset.pandas import PandasDataset
label_desc: Use image node_id 1 for calling a global function with example usage: generate_airpassengers_dataset(dataset_path, dataset_writer) without return types