code: def __read_gtn_data(self, directory):
      edges = pickle.load(open(osp.join(directory, "edges.pkl"), "rb"))
      labels = pickle.load(
          open(osp.join(directory, "labels.pkl"), "rb")
      )
      node_features = pickle.load(
          open(osp.join(directory, "node_features.pkl"), "rb")
      )
  
      data = Data()
      data.x = torch.from_numpy(node_features).float()
  
      num_nodes = edges[0].shape[0]
  
      node_type = np.zeros(num_nodes, dtype=int)
      assert len(edges) == 4
      assert len(edges[0].nonzero()) == 2
  
      node_type[edges[0].nonzero()[0]] = 0
      node_type[edges[0].nonzero()[1]] = 1
      node_type[edges[1].nonzero()[0]] = 1
      node_type[edges[1].nonzero()[1]] = 0
      node_type[edges[2].nonzero()[0]] = 0
      node_type[edges[2].nonzero()[1]] = 2
      node_type[edges[3].nonzero()[0]] = 2
      node_type[edges[3].nonzero()[1]] = 0
  
      print(node_type)
      data.pos = torch.from_numpy(node_type)
  
      edge_list = []
      for i, edge in enumerate(edges):
          edge_tmp = torch.from_numpy(
              np.vstack((edge.nonzero()[0], edge.nonzero()[1]))
          ).long()
          edge_list.append(edge_tmp)
      data.edge_index = torch.cat(edge_list, 1)
  
      A = []
      for i, edge in enumerate(edges):
          edge_tmp = torch.from_numpy(
              np.vstack((edge.nonzero()[0], edge.nonzero()[1]))
          ).long()
          value_tmp = torch.ones(edge_tmp.shape[1]).float()
          A.append((edge_tmp, value_tmp))
      edge_tmp = torch.stack(
          (torch.arange(0, num_nodes), torch.arange(0, num_nodes))
      ).long()
      value_tmp = torch.ones(num_nodes).float()
      A.append((edge_tmp, value_tmp))
      data.adj = A
  
      data.train_node = torch.from_numpy(
          np.array(labels[0])[:, 0]
      ).long()
      data.train_target = torch.from_numpy(
          np.array(labels[0])[:, 1]
      ).long()
      data.valid_node = torch.from_numpy(
          np.array(labels[1])[:, 0]
      ).long()
      data.valid_target = torch.from_numpy(
          np.array(labels[1])[:, 1]
      ).long()
      data.test_node = torch.from_numpy(
          np.array(labels[2])[:, 0]
      ).long()
      data.test_target = torch.from_numpy(
          np.array(labels[2])[:, 1]
      ).long()
  
      y = np.zeros(num_nodes, dtype=int)
      x_index = torch.cat(
          (data.train_node, data.valid_node, data.test_node)
      )
      y_index = torch.cat(
          (data.train_target, data.valid_target, data.test_target)
      )
      y[x_index.numpy()] = y_index.numpy()
      data.y = torch.from_numpy(y)
      self.__data = data
  
imports: import os
  import os.path
  import shutil
  import pickle
  import numpy
  import torch
  import typing
  from autogl.data import Data, download_url, InMemoryStaticGraphSet
  from autogl.data.graph import GeneralStaticGraphGenerator
  from ._dataset_registry import DatasetUniversalRegistry
  from ._data_source import OnlineDataSource
  from ..None import backend
label_desc: Use image node_id 4 for calling the _GTNDataSource obj's underlying member method code with example usage: obj.__read_gtn_data(directory) without return types