code: def add_ts_dataframe(
      data_iterator: Iterator[DataEntry], freq
  ) -> Iterator[DataEntry]:
      for data_entry in data_iterator:
          data = data_entry.copy()
  
          index = pd.date_range(
              start=data["start"],
              freq=freq,
              periods=data["target"].shape[-1],
          )
          data["ts"] = pd.DataFrame(
              index=index, data=data["target"].transpose()
          )
          yield data
  
imports: import json
  import pickle
  import random
  import torch
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from typing import Iterator
  from gluonts.dataset.common import DataEntry, Dataset, ListDataset
label_desc: Use image node_id 4 for calling a global function with example usage: add_ts_dataframe(data_iterator, freq) without return types