code: def _convert_gc_dataset(
      train_size, node_dict, edge_dict, label_dict, path, q_type
  ):
      total_num = 11000
  
      def convert(file):
          dataset = []
          d = dict()
          with open(file, "r") as f:
              for i, line in enumerate(f.readlines()):
                  line = line.strip().split()
                  if line[0] == "1" and len(d) > 0:
                      d = dict()
                  if line[1] == "eval":
                      # (src, edge, label)
                      if "eval" not in d:
                          d["eval"] = (
                              node_dict[line[2]],
                              edge_dict[line[3]],
                              node_dict[line[4]],
                              label_dict[line[5]],
                          )
                          if d["eval"][1] == q_type:
                              dataset.append(d)
                              if len(dataset) >= total_num:
                                  break
                  else:
                      if "edges" not in d:
                          d["edges"] = []
                      d["edges"].append(
                          (
                              node_dict[line[1]],
                              edge_dict[line[2]],
                              node_dict[line[3]],
                          )
                      )
          return dataset
  
      download_dir = get_download_dir()
      filename = os.path.join(
          download_dir, "babi_data", path, "data.txt"
      )
      data = convert(filename)
  
      assert len(data) == total_num
  
      train_set = data[:train_size]
      dev_set = data[950:1000]
      test_sets = []
      for i in range(10):
          test = data[1000 * (i + 1) : 1000 * (i + 2)]
          test_sets.append(test)
  
      return train_set, dev_set, test_sets
  
file_path: dgl/examples/pytorch/ggnn/data_utils.py
imports: import os
  import string
  import dgl
  import torch
  from dgl.data.utils import _get_dgl_url, download, extract_archive, get_download_dir
  from torch.utils.data import DataLoader
label_desc: Use image node_id 5 for calling a global function with example usage: _convert_gc_dataset(train_size, node_dict, edge_dict, label_dict, path, q_type) and returns: train_set,  dev_set,  test_sets, dataset