code: def induced_edge_automorphism_orbits(edge_list):
      ##### node automorphism orbits #####
      graph = gt.Graph(directed=False)
      graph.add_edge_list(edge_list)
      gt.stats.remove_self_loops(graph)
      gt.stats.remove_parallel_edges(graph)
  
      # compute the node automorphism group
      aut_group = gt_topology.subgraph_isomorphism(
          graph, graph, induced=False, subgraph=True, generator=False
      )
  
      orbit_membership = {}
      for v in graph.get_vertices():
          orbit_membership[v] = v
  
      # whenever two nodes can be mapped via some automorphism, they are assigned the same orbit
      for aut in aut_group:
          for original, node in enumerate(aut):
              role = min(original, orbit_membership[node])
              orbit_membership[node] = role
  
      orbit_membership_list = [[], []]
      for node, om_curr in orbit_membership.items():
          orbit_membership_list[0].append(node)
          orbit_membership_list[1].append(om_curr)
  
      # make orbit list contiguous (i.e. 0,1,2,...O)
      _, contiguous_orbit_membership = np.unique(
          orbit_membership_list[1], return_inverse=True
      )
  
      orbit_membership = {
          node: contiguous_orbit_membership[i]
          for i, node in enumerate(orbit_membership_list[0])
      }
  
      aut_count = len(aut_group)
  
      ##### induced edge automorphism orbits (according to the node automorphism group) #####
      edge_orbit_partition = dict()
      edge_orbit_membership = dict()
      edge_orbits2inds = dict()
      ind = 0
  
      edge_list = to_undirected(torch.tensor(graph.get_edges()))
  
      # infer edge automorphisms from the node automorphisms
      for i, edge in enumerate(edge_list):
          edge_orbit = frozenset(
              [orbit_membership[edge[0]], orbit_membership[edge[1]]]
          )
          if edge_orbit not in edge_orbits2inds:
              edge_orbits2inds[edge_orbit] = ind
              ind_edge_orbit = ind
              ind += 1
          else:
              ind_edge_orbit = edge_orbits2inds[edge_orbit]
  
          if ind_edge_orbit not in edge_orbit_partition:
              edge_orbit_partition[ind_edge_orbit] = [tuple(edge)]
          else:
              edge_orbit_partition[ind_edge_orbit] += [tuple(edge)]
  
          edge_orbit_membership[i] = ind_edge_orbit
  
      print(
          "Edge orbit partition of given substructure: {}".format(
              edge_orbit_partition
          )
      )
      print(
          "Number of edge orbits: {}".format(len(edge_orbit_partition))
      )
      print("Graph (node) automorphism count: {}".format(aut_count))
  
      return (
          graph,
          edge_orbit_partition,
          edge_orbit_membership,
          aut_count,
      )
  
file_path: dgl/examples/pytorch/ogb/directional_GSN/preprocessing.py
imports: import os
  import graph_tool
  import graph_tool.topology
  import networkx
  import numpy
  import torch
  from dgl.data.utils import load_graphs, save_graphs
  from ogb.graphproppred import DglGraphPropPredDataset
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: induced_edge_automorphism_orbits(edge_list) and returns: graph,  edge_orbit_partition,  edge_orbit_membership,  aut_count