code: def test_io_speed() -> None:
      exp_size = 250
      act_size = 0
  
      with Timer() as timer:
          dataset = ComplexSeasonalTimeSeries(
              num_series=exp_size,
              freq_str="D",
              length_low=100,
              length_high=200,
              min_val=0.0,
              max_val=20000.0,
              proportion_missing_values=0.1,
          ).generate()
      print(f"Test data generation took {timer.interval} seconds")
  
      # name of method, loading function and min allowed throughput
      fixtures = [
          ("baseline", baseline, 60_000),
          # ('json.loads', load_json, xxx),
          ("json.loads", load_json, 20_000),
          ("JsonLinesFile", load_json_lines_file, 10_000),
          ("ListDataset", load_list_dataset, 500),
          ("FileDataset", load_file_dataset, 500),
          ("FileDatasetCached", load_file_dataset_cached, 500),
          ("FileDatasetNumpy", load_file_dataset_numpy, 500),
          ("ParsedDataset", load_parsed_dataset, 500),
      ]
  
      with tempfile.TemporaryDirectory() as path:
          # save the generated dataset to a temporary folder
          with Timer() as timer:
              dataset.save(path)
          print(f"Test data saving took {timer.interval} seconds")
  
          # for each loader, read the dataset, assert that the number of lines is
          # correct, and record the lines/sec rate
          rates = {}
          for name, get_loader, _ in fixtures:
              with Timer() as timer:
                  loader = get_loader(
                      Path(path) / "train", dataset.metadata.freq
                  )
                  for act_size, _ in enumerate(loader, start=1):
                      pass
              rates[name] = int(act_size / max(timer.interval, 0.00001))
              print(
                  f"Loader {name:13} achieved a rate of {rates[name]:10} "
                  f"lines/second"
              )
              assert exp_size == act_size, (
                  f"Loader {name} did not yield the expected number of "
                  f"{exp_size} lines"
              )
  
          # for each loader, assert that throughput is above threshold
          for name, _, min_rate in fixtures:
              assert min_rate <= rates[name], (
                  f"The throughput of {name} ({rates[name]} lines/second) "
                  f"was below the allowed maximum rate {min_rate}."
              )
  
imports: import tempfile
  import time
  from pathlib import Path
  from typing import Any, Iterator
  import numpy
  import pandas
  import pytest
  from gluonts.dataset.artificial import ComplexSeasonalTimeSeries
  from gluonts import json
  from gluonts.dataset.common import FileDataset, ListDataset
  from gluonts.dataset.jsonl import JsonLinesFile
label_desc: Use image node_id 10 for calling a global function with example usage: test_io_speed() without return types