code: def get_adj_and_degrees(num_nodes, triplets):
      """Get adjacency list and degrees of the graph"""
      adj_list = [[] for _ in range(num_nodes)]
      for i, triplet in enumerate(triplets):
          adj_list[triplet[0]].append([i, triplet[2]])
          adj_list[triplet[2]].append([i, triplet[0]])
  
      degrees = np.array([len(a) for a in adj_list])
      adj_list = [np.array(a) for a in adj_list]
      return adj_list, degrees
  
file_path: dgl/examples/tensorflow/rgcn/utils.py
imports: import dgl
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: get_adj_and_degrees(num_nodes, triplets) and returns: adj_list,  degrees