code: def read_sentigraph_data(folder: str, prefix: str):
      txt_files = glob.glob(
          os.path.join(folder, "{}_*.txt".format(prefix))
      )
      json_files = glob.glob(
          os.path.join(folder, "{}_*.json".format(prefix))
      )
      txt_names = [
          f.split(os.sep)[-1][len(prefix) + 1 : -4] for f in txt_files
      ]
      json_names = [
          f.split(os.sep)[-1][len(prefix) + 1 : -5] for f in json_files
      ]
      names = txt_names + json_names
  
      with open(
          os.path.join(folder, prefix + "_node_features.pkl"), "rb"
      ) as f:
          x: np.array = pickle.load(f)
      x: torch.FloatTensor = torch.from_numpy(x)
      edge_index: np.array = read_file(folder, prefix, "edge_index")
      edge_index: torch.tensor = torch.tensor(
          edge_index, dtype=torch.long
      ).T
      batch: np.array = (
          read_file(folder, prefix, "node_indicator") - 1
      )  # from zero
      y: np.array = read_file(folder, prefix, "graph_labels")
      y: torch.tensor = torch.tensor(y, dtype=torch.long)
  
      supplement = dict()
      if "split_indices" in names:
          split_indices: np.array = read_file(
              folder, prefix, "split_indices"
          )
          split_indices = torch.tensor(split_indices, dtype=torch.long)
          supplement["split_indices"] = split_indices
      if "sentence_tokens" in names:
          with open(
              os.path.join(folder, prefix + "_sentence_tokens.json")
          ) as f:
              sentence_tokens: dict = json.load(f)
          supplement["sentence_tokens"] = sentence_tokens
  
      data = Data(x=x, edge_index=edge_index, y=y)
      data, slices = split(data, batch)
  
      return data, slices, supplement
  
imports: import os
  import glob
  import json
  import torch
  import pickle
  import numpy
  import os.path
  from torch_geometric.data import Data, InMemoryDataset
  import traceback
label_desc: Use image node_id 4 for calling a global function with example usage: read_sentigraph_data(folder, prefix) and returns: data,  slices,  supplement