code: def load_data(prefix, normalize=True, load_walks=False):
      def obj2int(n):
          return int(n)
  
      def just_return(n):
          return n
  
      G_data = json.load(open(prefix + "-G.json"))
      G = json_graph.node_link_graph(G_data)
      if isinstance(G.nodes()[0], int):
          conversion = obj2int
      else:
          conversion = just_return
  
      if os.path.exists(prefix + "-feats.npy"):
          feats = np.load(prefix + "-feats.npy")
      else:
          print(
              "No features present.. Only identity features will be used."
          )
          feats = None
      id_map = json.load(open(prefix + "-id_map.json"))
      id_map = {conversion(k): int(v) for k, v in id_map.items()}
      walks = []
      class_map = json.load(open(prefix + "-class_map.json"))
      if isinstance(list(class_map.values())[0], list):
          lab_conversion = just_return
      else:
          lab_conversion = obj2int
  
      class_map = {
          conversion(k): lab_conversion(v) for k, v in class_map.items()
      }
  
      # Remove all nodes that do not have val/test annotations
      # (necessary because of networkx weirdness with the Reddit data)
      broken_count = 0
      for node in G.nodes():
          if "val" not in G.node[node] or "test" not in G.node[node]:
              G.remove_node(node)
              broken_count += 1
      print(
          "Removed {:d} nodes that lacked proper annotations due to networkx \
             versioning issues".format(
              broken_count
          )
      )
  
      # Make sure the graph has edge train_removed annotations
      # (some datasets might already have this..)
      print("Loaded data.. now preprocessing..")
      for edge in G.edges():
          if (
              G.node[edge[0]]["val"]
              or G.node[edge[1]]["val"]
              or G.node[edge[0]]["test"]
              or G.node[edge[1]]["test"]
          ):
              G[edge[0]][edge[1]]["train_removed"] = True
          else:
              G[edge[0]][edge[1]]["train_removed"] = False
  
      if normalize and feats is not None:
          from sklearn.preprocessing import StandardScaler
  
          train_ids = np.array(
              [
                  id_map[n]
                  for n in G.nodes()
                  if not G.node[n]["val"] and not G.node[n]["test"]
              ]
          )
          train_feats = feats[train_ids]
          scaler = StandardScaler()
          scaler.fit(train_feats)
          feats = scaler.transform(feats)
  
      if load_walks:
          with open(prefix + "-walks.txt") as fp:
              for line in fp:
                  walks.append(map(conversion, line.split()))
  
      return G, feats, id_map, walks, class_map
  
file_path: euler/tf_euler/python/dataset/sage_util.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  import random
  import numpy
  import networkx
  from networkx.readwrite import json_graph
label_desc: Use image node_id 1 for calling a global function with example usage: load_data(prefix, normalize, load_walks) and returns: G,  feats,  id_map,  walks,  class_map, int, n