code: def run_thread(arguments):
      mentions = arguments["data"]
      candidate_generator = arguments["candidate_generator"]
      args = arguments["args"]
      if args.keep_pregenerated_candidates:
          data_fetcher = arguments["pregenereted_cands_data_fetcher"]
  
      if arguments["id"] == 0:
          print("Query args: ", candidate_generator.query_arguments)
          print_query_flag = True
          for mention in tqdm(mentions):
              mention[
                  "generated_candidates"
              ] = candidate_generator.get_candidates(
                  mention, print_query_flag=print_query_flag
              )
              print_query_flag = False
  
              if args.keep_pregenerated_candidates:
                  wikidata_ids = mention["candidates_wikidata_ids"]
                  mention[
                      "candidates_data"
                  ] = data_fetcher.get_candidates_data(wikidata_ids)
      else:
          for mention in mentions:
              mention[
                  "generated_candidates"
              ] = candidate_generator.get_candidates(mention)
              if args.keep_pregenerated_candidates:
                  wikidata_ids = mention["candidates_wikidata_ids"]
                  mention[
                      "candidates_data"
                  ] = data_fetcher.get_candidates_data(wikidata_ids)
  
      return arguments["id"], mentions
  
file_path: BLINK/blink/candidate_retrieval/perform_and_evaluate_candidate_retrieval_multithreaded.py
imports: from multiprocessing.pool import ThreadPool
  from candidate_generators import Simple_Candidate_Generator, Pregenerated_Candidates_Data_Fetcher
  import multiprocessing
  import utils
  import time
  import argparse
  import pickle
  import os
  from evaluator import Evaluator
  from tqdm import tqdm
  import pysolr
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: run_thread(arguments) and returns: arguments,  mentions