code: def get_amazon_sales():
      f = open("./dataset/sgc_train.json", encoding="utf-8")
      dataset_group = [[] for i in range(8)]
      whole_data = []
      ret = dict()
      X = []
      Y = []
      # split_grid = [0.04, 0.1, 0.25, 0.5, 1, 10, 100, 5000]
      for line in f.readlines():
          # gid = 0
          dic = json.loads(line)
          var = torch.var(torch.FloatTensor(dic["target"])).item()
          if var > 5000:
              continue
          nu = 1 + sum(dic["target"]) / len(dic["target"])
          ts = [i / nu for i in dic["target"]]
          start = dic["start"]
          # ts = dic['target']
          if len(ts) < 28:
              continue
          X.append((ts, var))
      X = sorted(X, key=lambda x: x[1])
      X = [x[0] for x in X]
      length = int(len(X) / 8)
      for gid in range(8):
          for j in range(gid * length, (gid + 1) * length):
              whole_data.append({"target": X[j], "start": start})
              dataset_group[gid].append(
                  {"target": X[j], "start": start}
              )
      random.shuffle(whole_data)
      ret["whole_data"] = ListDataset(whole_data, freq="1H")
      group_list = []
      for group in dataset_group:
          random.shuffle(group)
          group_list.append(ListDataset(group, freq="1H"))
      ret["group_data"] = group_list
      print("write whole data")
      with open("synthetic_sales_time_whole_data.csv", "wb") as output:
          pickle.dump(ret["whole_data"], output)
      print("write group data")
      with open("synthetic_sales_time_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 3 for calling a global function with example usage: get_amazon_sales() and returns: True