code: def write_dgl_objects(
      graph_obj,
      node_features,
      edge_features,
      output_dir,
      part_id,
      orig_nids,
      orig_eids,
      formats,
      sort_etypes,
  ):
      """
      Wrapper function to write graph, node/edge feature, original node/edge IDs.
  
      Parameters:
      -----------
      graph_obj : dgl object
          graph dgl object as created in convert_partition.py file
      node_features : dgl object
          Tensor data for node features
      edge_features : dgl object
          Tensor data for edge features
      output_dir : string
          location where the output files will be located
      part_id : int
          integer indicating the partition-id
      orig_nids : dict
          original node IDs
      orig_eids : dict
          original edge IDs
      formats : str or list[str]
          Save graph in formats.
      sort_etypes : bool
          Whether to sort etypes in csc/csr.
      """
      part_dir = output_dir + "/part" + str(part_id)
      os.makedirs(part_dir, exist_ok=True)
      write_graph_dgl(
          os.path.join(part_dir, "graph.dgl"),
          graph_obj,
          formats,
          sort_etypes,
      )
  
      if node_features != None:
          write_node_features(
              node_features, os.path.join(part_dir, "node_feat.dgl")
          )
  
      if edge_features != None:
          write_edge_features(
              edge_features, os.path.join(part_dir, "edge_feat.dgl")
          )
  
      if orig_nids is not None:
          orig_nids_file = os.path.join(part_dir, "orig_nids.dgl")
          dgl.data.utils.save_tensors(orig_nids_file, orig_nids)
      if orig_eids is not None:
          orig_eids_file = os.path.join(part_dir, "orig_eids.dgl")
          dgl.data.utils.save_tensors(orig_eids_file, orig_eids)
  
imports: import json
  import logging
  import os
  from itertools import cycle
  import constants
  import dgl
  import numpy
  import psutil
  import pyarrow
  import torch
  from dgl.distributed.partition import _dump_part_config
  from pyarrow import csv
label_desc: Use image node_id 17 for calling a global function with example usage: write_dgl_objects(graph_obj, node_features, edge_features, output_dir, part_id, orig_nids, orig_eids, formats, sort_etypes) without return types