code: def get_group_data_by_hash(name, q, num_groups):
      dataset = get_dataset(name)
      dataset_group = [[] for i in range(num_groups)]
      whole_data = []
      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)
          dataset_group[i % num_groups].append(
              {
                  "target": train_entry["target"],
                  "start": train_entry["start"],
              }
          )
          whole_data.append(
              {
                  "target": train_entry["target"],
                  "start": train_entry["start"],
              }
          )
      random.shuffle(whole_data)
      ret.append(ListDataset(whole_data, freq=dataset.metadata.freq))
      for group in dataset_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 5 for calling a global function with example usage: get_group_data_by_hash(name, q, num_groups) and returns: ret,  dataset