code: def test_dataset_writer(writer):
      dataset = get_dataset("constant")
  
      with TemporaryDirectory() as temp_dir:
          writer.write_to_folder(dataset.train, Path(temp_dir))
  
          loaded = FileDataset(Path(temp_dir), freq="h")
          assert len(dataset.train) == len(loaded)
  
file_path: gluonts/test/dataset/test_writer.py
imports: import sys
  from pathlib import Path
  from tempfile import TemporaryDirectory
  import pytest
  from gluonts.dataset.common import FileDataset
  from gluonts.dataset.arrow import ArrowWriter, ParquetWriter
  from gluonts.dataset.jsonl import JsonLinesWriter
  from gluonts.dataset.repository import get_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_dataset_writer(writer) without return types