code: def extract_graph_mp(kg_graph, n_pool=1) -> None:
      """Use multiprocessing to parallize graph extraction.
  
      Args:
        kg_graph: the global KG (i.e. WikiData Knowledge Graph), stored as dict.
        n_pool: number of process (worker)
      """
      jobs = []
      if not gfile.Exists(data_util.WIKIPEDIA_GRAPH_PATH):
          gfile.MakeDirs(data_util.WIKIPEDIA_GRAPH_PATH)
      if n_pool == 1:
          for i in range(data_util.NUM_SPLIT):
              extract_graph_from_file(kg_graph, i)
      else:
          with mp.Pool(n_pool) as pool:
              for i in range(data_util.NUM_SPLIT):
                  jobs += [
                      pool.apply_async(
                          extract_graph_from_file, args=(kg_graph, i)
                      )
                  ]
              for job in tqdm.tqdm(jobs):
                  job.get()
  
file_path: scenic/scenic/projects/knowledge_visual_language/data/wikidata/extract_wikigraph.py
imports: import json
  import multiprocessing
  import os
  from absl import app
  from absl import logging
  from scenic.projects.knowledge_visual_language.data.wikidata import data_util
  import tqdm
  import tensorflow
  from tf.io import gfile
label_desc: Use image node_id 2 for calling a global function with example usage: extract_graph_mp(kg_graph, n_pool) without return types