code: def test_partition(
      part_method,
      num_parts,
      num_trainers_per_machine,
      load_feats,
      graph_formats,
  ):
      os.environ["DGL_DIST_DEBUG"] = "1"
      if part_method == "random" and num_parts > 1:
          num_trainers_per_machine = 1
      g = create_random_graph(1000)
      check_partition(
          g,
          part_method,
          num_parts,
          num_trainers_per_machine,
          load_feats,
          graph_formats,
      )
      hg = create_random_hetero()
      check_hetero_partition(
          hg,
          part_method,
          num_parts,
          num_trainers_per_machine,
          load_feats,
          graph_formats,
      )
      reset_envs()
  
imports: import json
  import os
  import tempfile
  import backend
  import dgl
  import numpy
  import pytest
  import torch
  from dgl import function
  from dgl.distributed import convert_dgl_partition_to_csc_sampling_graph, load_partition, load_partition_book, load_partition_feats, partition_graph
  from dgl.distributed.graph_partition_book import _etype_str_to_tuple, _etype_tuple_to_str, DEFAULT_ETYPE, DEFAULT_NTYPE, EdgePartitionPolicy, HeteroDataName, NodePartitionPolicy, RangePartitionBook
  from dgl.distributed.partition import _get_inner_edge_mask, _get_inner_node_mask, RESERVED_FIELD_DTYPE
  from scipy import sparse
  from utils import reset_envs
label_desc: Use image node_id 9 for calling a global function with example usage: test_partition(part_method, num_parts, num_trainers_per_machine, load_feats, graph_formats) without return types