class_docstr: Class for constructing DGLGraph from Node/Edge/Graph data. Internal use only.
class_docstr_tok: ["Class","for","constructing","DGLGraph","from","Node\/Edge\/Graph","data",".","Internal","use","only","."]
code: def _construct_graphs(node_dict, edge_dict):
      graph_dict = {}
      for graph_id in node_dict:
          if graph_id not in edge_dict:
              edge_dict[graph_id][("_V", "_E", "_V")] = {
                  "edges": ([], [])
              }
          graph = dgl_heterograph(
              {
                  etype: edata["edges"]
                  for etype, edata in edge_dict[graph_id].items()
              },
              num_nodes_dict={
                  ntype: len(ndata["mapping"])
                  for ntype, ndata in node_dict[graph_id].items()
              },
          )
  
          def assign_data(type, src_data, dst_data):
              for key, value in src_data.items():
                  dst_data[type].data[key] = value
  
          for type, data in node_dict[graph_id].items():
              assign_data(type, data["data"], graph.nodes)
          for (type), data in edge_dict[graph_id].items():
              assign_data(type, data["data"], graph.edges)
          graph_dict[graph_id] = graph
      return graph_dict
  
imports: import ast
  import os
  from typing import Callable, List, Optional
  import numpy
  import pandas
  import pydantic
  import yaml
  from ..None import backend
  from ..base import dgl_warning, DGLError
  from ..convert import heterograph
label_desc: Use image node_id 2 for calling the DGLGraphConstructor obj's underlying member method code with example usage: obj._construct_graphs(node_dict, edge_dict) and returns: graph_dict