code: def reorder_data(num_parts, world_size, data, key):
      """
      Auxiliary function used to sort node and edge data for the input graph.
  
      Parameters:
      -----------
      num_parts : int
          total no. of partitions
      world_size : int
          total number of nodes used in this execution
      data : dictionary
          which is used to store the node and edge data for the input graph
      key : string
          specifies the column which is used to determine the sort order for
          the remaining columns
  
      Returns:
      --------
      dictionary
          same as the input dictionary, but with reordered columns (values in
          the dictionary), as per the np.argsort results on the column specified
          by the ``key`` column
      """
      for local_part_id in range(num_parts // world_size):
          sorted_idx = data[key + "/" + str(local_part_id)].argsort()
          for k, v in data.items():
              tokens = k.split("/")
              assert len(tokens) == 2
              if tokens[1] == str(local_part_id):
                  data[k] = v[sorted_idx]
          sorted_idx = None
      gc.collect()
      return data
  
imports: import gc
  import logging
  import math
  import os
  import sys
  from datetime import timedelta
  from timeit import default_timer
  import constants
  import dgl
  import numpy
  import torch
  import torch.distributed
  import torch.multiprocessing
  from convert_partition import create_dgl_object, create_metadata_json
  from dataset_utils import get_dataset
  from dist_lookup import DistLookupService
  from globalids import assign_shuffle_global_nids_edges, assign_shuffle_global_nids_nodes, lookup_shuffle_global_nids_edges
  from gloo_wrapper import allgather_sizes, alltoallv_cpu, gather_metadata_json
  from utils import augment_edge_data, DATA_TYPE_ID, get_edge_types, get_etype_featnames, get_gid_offsets, get_gnid_range_map, get_idranges, get_node_types, get_ntype_counts_map, get_ntype_featnames, map_partid_rank, memory_snapshot, read_json, read_ntype_partition_files, REV_DATA_TYPE_ID, write_dgl_objects, write_metadata_json
label_desc: Use image node_id 7 for calling a global function with example usage: reorder_data(num_parts, world_size, data, key) and returns: data