code: def get_group_data_by_duplicate(name, num_duplicates, num_groups):
      dataset = get_dataset(name)
      dataset_group = [[] for i in range(num_groups)]
      whole_data_list = []
      no_duplicate_whole_data_list = []
      ret = []
      it = iter(dataset.train)
      num_ts = int(dataset.metadata.feat_static_cat[0].cardinality)
      for i in range(num_ts):
          train_entry = next(it)
          no_duplicate_whole_data_list.append(
              {
                  "target": train_entry["target"],
                  "start": train_entry["start"],
              }
          )
          for j in range(num_duplicates):
              dataset_group[i % num_groups].append(
                  {
                      "target": train_entry["target"],
                      "start": train_entry["start"],
                  }
              )
              whole_data_list.append(
                  {
                      "target": train_entry["target"],
                      "start": train_entry["start"],
                  }
              )
      random.shuffle(whole_data_list)
      random.shuffle(no_duplicate_whole_data_list)
      ret.append(
          ListDataset(
              no_duplicate_whole_data_list, freq=dataset.metadata.freq
          )
      )
      ret.append(
          ListDataset(whole_data_list, freq=dataset.metadata.freq)
      )
      for group in dataset_group:
          random.shuffle(group)
          ret.append(ListDataset(group, freq=dataset.metadata.freq))
      return ret, dataset.metadata.freq
  
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 6 for calling a global function with example usage: get_group_data_by_duplicate(name, num_duplicates, num_groups) and returns: ret,  dataset