code: def check_sparse_adam(num_trainer=1, shared_mem=True):
      prepare_dist()
      g = create_random_graph(2000)
      num_servers = num_trainer
      num_clients = num_trainer
      num_parts = 1
  
      graph_name = "dist_graph_test"
      partition_graph(g, graph_name, num_parts, "/tmp/dist_graph")
  
      # let's just test on one partition for now.
      # We cannot run multiple servers and clients on the same machine.
      serv_ps = []
      ctx = mp.get_context("spawn")
      for serv_id in range(num_servers):
          p = ctx.Process(
              target=run_server,
              args=(
                  graph_name,
                  serv_id,
                  num_servers,
                  num_clients,
                  shared_mem,
              ),
          )
          serv_ps.append(p)
          p.start()
  
      cli_ps = []
      for cli_id in range(num_clients):
          print("start client", cli_id)
          p = ctx.Process(
              target=run_client,
              args=(graph_name, cli_id, 0, num_servers),
          )
          p.start()
          cli_ps.append(p)
  
      for p in cli_ps:
          p.join()
  
      for p in serv_ps:
          p.join()
  
imports: import os
  import multiprocessing
  import pickle
  import random
  import socket
  import sys
  import time
  import unittest
  import backend
  import dgl
  import numpy
  import torch
  from dgl import function
  from dgl.distributed import DistEmbedding, DistGraph, DistGraphServer, load_partition_book, partition_graph
  from dgl.distributed.optim import SparseAdagrad, SparseAdam
  from scipy import sparse
label_desc: Use image node_id 7 for calling a global function with example usage: check_sparse_adam(num_trainer, shared_mem) without return types