code: def preselect_anchor(data, args, num_workers=4):
      pool = get_context("spawn").Pool(processes=num_workers)
      # Pre-compute anchor sets, a collection of anchor sets per epoch
      anchor_set_ids = [
          get_anchors(data["num_nodes"]) for _ in range(args.epoch_num)
      ]
      interval_size = len(anchor_set_ids) / num_workers
      results = [
          pool.apply_async(
              get_graphs,
              args=(
                  data,
                  anchor_set_ids[
                      int(interval_size * i) : int(
                          interval_size * (i + 1)
                      )
                  ],
              ),
          )
          for i in range(num_workers)
      ]
  
      output = [p.get() for p in results]
      graphs, anchor_eids, dists_max_list, edge_weights = merge_result(
          output
      )
      pool.close()
      pool.join()
  
      return graphs, anchor_eids, dists_max_list, edge_weights
  
imports: import multiprocessing
  import random
  from multiprocessing import get_context
  import networkx
  import numpy
  import torch
  from tqdm.auto import tqdm
label_desc: Use image node_id 17 for calling a global function with example usage: preselect_anchor(data, args, num_workers) and returns: graphs,  anchor_eids,  dists_max_list,  edge_weights