code: def random_partition(metadata, num_parts, output_path):
      """
      Randomly partition the graph described in metadata and generate partition ID mapping
      in :attr:`output_path`.
  
      A directory will be created at :attr:`output_path` containing the partition ID
      mapping files named "<node-type>.txt" (e.g. "author.txt", "paper.txt" and
      "institution.txt" for OGB-MAG240M).  Each file contains one line per node representing
      the partition ID the node belongs to.
      In addition, metadata which includes version, number of partitions is dumped.
      """
      with setdir(output_path):
          _random_partition(metadata, num_parts)
          part_meta = PartitionMeta(
              version="1.0.0", num_parts=num_parts, algo_name="random"
          )
          dump_partition_meta(part_meta, "partition_meta.json")
  
file_path: dgl/tools/partition_algo/random_partition.py
imports: import argparse
  import json
  import logging
  import os
  import numpy
  from base import dump_partition_meta, PartitionMeta
  from distpartitioning import array_readwriter
  from files import setdir
label_desc: Use image node_id 2 for calling a global function with example usage: random_partition(metadata, num_parts, output_path) without return types