code: def get_temperature_data(
      context_length=24,
      prediction_length=4,
      samples_per_ts=2000,
      num_groups=8,
  ):
      ts_file = pd.read_csv("temperature.csv")
      city_names = [
          "Vancouver",
          "Los Angeles",
          "Las Vegas",
          "San Diego",
          "Philadelphia",
          "Montreal",
          "Boston",
          "Haifa",
      ]
      datetime = ts_file["datetime"]
      dataset_group = [[] for i in range(num_groups)]
      whole_data = []
      ret = dict()
      for gid in range(num_groups):
          ts = ts_file[city_names[gid]]
          num_samples = 0
          index = 0
          while True:
              num_samples += 1
              index += 1
              ts_slice = torch.tensor(
                  ts[
                      index : index + context_length + prediction_length
                  ].values
              )
              nu = 1 + sum(ts_slice) / len(ts_slice)
              ts_slice /= nu
              if torch.sum(torch.isnan(ts_slice)).item() == 0:
                  dataset_group[gid].append(
                      {
                          "target": ts_slice,
                          "start": pd.Timestamp(datetime[index]),
                      }
                  )
                  whole_data.append(
                      {
                          "target": ts_slice,
                          "start": pd.Timestamp(datetime[index]),
                      }
                  )
              if num_samples == samples_per_ts:
                  break
      random.shuffle(whole_data)
      ret["whole_data"] = ListDataset(whole_data, freq="1H")
      group_data_list = []
      for group in dataset_group:
          random.shuffle(group)
          group_data_list.append(ListDataset(group, freq="1H"))
      ret["group_data"] = group_data_list
      print("write whole data")
      with open("synthetic_temperature_whole_data.csv", "wb") as output:
          pickle.dump(ret["whole_data"], output)
      print("write group data")
      with open("synthetic_temperature_group_data.csv", "wb") as output:
          pickle.dump(ret, output)
      return True
  
imports: from pts.dataset.repository.datasets import get_dataset, dataset_recipes
  from pts.dataset.utils import to_pandas
  import numpy
  import pandas
  from pts.dataset import ListDataset
  import torch
  from pts.model.simple_feedforward import SimpleFeedForwardEstimator
  import pickle
  import json
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: get_temperature_data(context_length, prediction_length, samples_per_ts, num_groups) and returns: True