code: def convert_to_dgl_graph(graph):
      # directed graph
      g = nx.DiGraph()
      for edge, weight in graph.items():
          nodes = edge.split(",")
          src, dst = int(nodes[0]), int(nodes[1])
          g.add_edge(src, dst, weight=float(weight))
  
      return dgl.from_networkx(g, edge_attrs=["weight"])
  
file_path: dgl/examples/pytorch/eges/utils.py
imports: import argparse
  import random
  from datetime import datetime
  import dgl
  import networkx
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: convert_to_dgl_graph(graph) and returns: dgl