code: def pyg_ego_nets(graph, radius=2):
      x = []
      edges = []
      egos = []
      for i in range(graph.num_nodes):
          egos.append(
              ego_graph(
                  graph.edge_index, graph.num_nodes, i, radius=radius
              )
          )
      id_bias = graph.num_nodes
      for i in range(len(egos)):
          x.append(graph.x[i])
      for i in range(len(egos)):
          for neighbor in egos[i][0]:
              if neighbor != i:
                  x.append(graph.x[neighbor])
          keys = list(egos[i][0])
          keys.remove(i)
          id_cur = len(egos[i][0])
          vals = range(id_bias, id_bias + id_cur)
          id_bias += id_cur
          mapping = dict(zip(keys, vals))
          ego_edge_list = egos[i][1]
          for node in ego_edge_list:
              neighbors = ego_edge_list[node]
              for neighbor in neighbors:
                  if node == i:
                      src = node
                  else:
                      src = mapping[node]
                  if neighbor == i:
                      dst = neighbor
                  else:
                      dst = mapping[neighbor]
                  edges.append([src, dst])
      edge_index = torch.tensor(edges, dtype=torch.long).t()
      x = torch.stack(x)
      return x, edge_index
  
file_path: deepsnap/benchmark/transform/ego_net.py
imports: import copy
  import time
  import torch
  import argparse
  import numpy
  from torch.utils.data import DataLoader
  from deepsnap.batch import Batch
  from deepsnap.dataset import GraphDataset
  from torch_geometric.datasets import TUDataset
label_desc: Use image node_id 4 for calling a global function with example usage: pyg_ego_nets(graph, radius) and returns: x,  edge_index