code: def RandomPartition(edges, n, has_importance=False):
      """This partitions a list of edges randomly across n partitions
  
      Parameters
      ----------
      edges : (heads, rels, tails) triple
          Edge list to partition
      n : int
          number of partitions
  
      Returns
      -------
      List of np.array
          Edges of each partition
      """
      if has_importance:
          heads, rels, tails, e_impts = edges
      else:
          heads, rels, tails = edges
      print(
          "random partition {} edges into {} parts".format(
              len(heads), n
          )
      )
      idx = np.random.permutation(len(heads))
      heads[:] = heads[idx]
      rels[:] = rels[idx]
      tails[:] = tails[idx]
      if has_importance:
          e_impts[:] = e_impts[idx]
  
      part_size = int(math.ceil(len(idx) / n))
      parts = []
      for i in range(n):
          start = part_size * i
          end = min(part_size * (i + 1), len(idx))
          parts.append(idx[start:end])
          print("part {} has {} edges".format(i, len(parts[-1])))
      return parts
  
imports: import math
  import numpy
  import scipy
  import dgl.backend
  import dgl
  import os
  import sys
  import pickle
  import time
  from dgl.base import NID, EID
  import pdb
label_desc: Use image node_id 3 for calling a global function with example usage: RandomPartition(edges, n, has_importance) and returns: parts