code: def test_partition_with_halo():
      g = create_large_graph(1000)
      node_part = np.random.choice(4, g.num_nodes())
      subgs, _, _ = dgl.transforms.partition_graph_with_halo(
          g, node_part, 2, reshuffle=True
      )
      for part_id, subg in subgs.items():
          node_ids = np.nonzero(node_part == part_id)[0]
          lnode_ids = np.nonzero(F.asnumpy(subg.ndata["inner_node"]))[0]
          orig_nids = F.asnumpy(subg.ndata["orig_id"])[lnode_ids]
          assert np.all(np.sort(orig_nids) == node_ids)
          assert np.all(
              F.asnumpy(subg.in_degrees(lnode_ids))
              == F.asnumpy(g.in_degrees(orig_nids))
          )
          assert np.all(
              F.asnumpy(subg.out_degrees(lnode_ids))
              == F.asnumpy(g.out_degrees(orig_nids))
          )
  
imports: import math
  import os
  import unittest
  import backend
  import dgl
  import dgl.function
  import dgl.partition
  import networkx
  import numpy
  import pytest
  from scipy import sparse
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 17 for calling a global function with example usage: test_partition_with_halo() without return types