code: def _random_partition(metadata, num_parts):
      num_nodes_per_type = metadata["num_nodes_per_type"]
      ntypes = metadata["node_type"]
      for ntype, n in zip(ntypes, num_nodes_per_type):
          logging.info("Generating partition for node type %s" % ntype)
          parts = np.random.randint(0, num_parts, (n,))
          array_readwriter.get_array_parser(name="csv").write(
              ntype + ".txt", parts
          )
  
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 1 for calling a global function with example usage: _random_partition(metadata, num_parts) without return types