def METHOD_NAME(
    dataset_path: Path,
    dataset_name: str,
    dataset_writer: DatasetWriter,
    prediction_length: Optional[int] = None,
):
    ds_info = datasets_info[dataset_name]
    download_dataset(dataset_path.parent, ds_info)
    train_data = get_data(dataset_path / "train", ds_info)
    test_data = get_data(dataset_path / "test", ds_info)
    meta = MetaData(
        **metadata(
            cardinality=ds_info.num_series,
            freq=ds_info.freq,
            prediction_length=prediction_length or ds_info.prediction_length,
        )
    )
    dataset = TrainDatasets(metadata=meta, train=train_data, test=test_data)
    dataset.save(
        path_str=str(dataset_path), writer=dataset_writer, overwrite=True
    )
    clean_up_dataset(dataset_path, ds_info)